Problem:


Score : 200 points

Problem Statement

La Confiserie d'ABC sells cakes at 4 dollars each and doughnuts at 7 dollars each.
Determine if there is a way to buy some of them for exactly N dollars. You can buy two or more doughnuts and two or more cakes, and you can also choose to buy zero doughnuts or zero cakes.

Constraints

N is an integer between 1 and 100, inclusive.

Input

Input is given from Standard Input in the following format:

N

Output

If there is a way to buy some cakes and some doughnuts for exactly N dollars, print Yes; otherwise, print No.

Sample Input 1

11

Sample Output 1

Yes

If you buy one cake and one doughnut, the total will be 4 + 7 = 11 dollars.

Sample Input 2

40

Sample Output 2

Yes

If you buy ten cakes, the total will be 4 \times 10 = 40 dollars.

Sample Input 3

3

Sample Output 3

No

The prices of cakes (4 dollars) and doughnuts (7 dollars) are both higher than 3 dollars, so there is no such way.



Sample input:
11


Sample output:
Yes

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
inf = 10**17
mod = 10**9 + 7
#s=input().rstrip()

n=I()
for i in range(100):
    for j in range(100):
        if 4*i+7*j==n:
            print("Yes")
            sys.exit()
print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
N = int(input())
if N == 1 or N == 2 or N == 3 or N == 5 or N == 6 or N == 9 or N == 10 or N == 13 or N == 17:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
n = int(input())
f = False
c = []
d = []
for i in range(n//4+1):
    c.append(i)

for i in range(n//7+1):
    d.append(i)

for i in range(len(c)):
    for j in range(len(d)):
        if c[i]*4+d[j]*7 == n:
            f = True
            break

if f:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
price = int(input())

flag = 0
top = price//4 + 1
for n in range(top+1):
  for m in range(top+1):
    if 4*n + 7*m == price:
      flag = 1
      break

if flag == 1:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N = int(input())

exist = False

for i in range(25):
    for j in range(15):
        if 4*i + 7*j == N:
            exist = True

if exist:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def nyu():
    N = int(input())
    return N

def check(N):

    success_flg = False
    while N >= 0:
        if N % 4 == 0:
            success_flg = True
            break
        
        N -= 7

        if N == 0:
            success_flg = True
            break
    
    if success_flg == True:
        print("Yes")
    else:
        print("No")







N = nyu()
check(N)

Submission status: Accepted

Solution code:
n = int(input())

ok = "No"
for cake in range(0, 26):
    for daunut in range(0, 15):
        if 4 * cake + 7 * daunut == n:
            # print(f"4 * {cake} + 7 * {daunut} == {n}")
            ok = "Yes"
            break
print(ok)

Submission status: Accepted

Solution code:
n = int(input())
for i in range(30):
    for j in range(20):
        if i * 4 + j * 7 == n:
            print('Yes')
            exit()

print('No')

Submission status: Accepted

Solution code:
import sys
n=int(input())
A=[]
d=n//7+1
for i in range(d):
    A.append(7*i)
for a in A:
    if (n-a)%4==0:
        print("Yes")
        sys.exit()
print("No")

Submission status: Accepted

Solution code:
n = int(input())
flag = False
for c in range(26):
    for d in range(15):
        if 4*c + 7*d == n:
            flag = True
print('Yes' if flag else 'No')

Submission status: Accepted

Solution code:
n=int(input())

for i in range(100):
    for j in range(100):
        p=4*i+7*j
        if p==n:
            print("Yes")
            exit()
            
print("No")

Submission status: Accepted

Solution code:
n=int(input())

for i in range(25):
    for j in range(14):
        p=4*i+7*j
        if p==n:
            print("Yes")
            exit()
            
print("No")

Submission status: Accepted

Solution code:
N = int(input())

jdg = False

for i in range(26):
    price4 = N - i * 4
    if price4 >= 0 and price4 % 7 == 0:
        jdg = True
        break
print('Yes' if jdg else 'No')

Submission status: Accepted

Solution code:
n=int(input())
keep=0
for i in range(0,30):
  for j in range(0,30):
    if i*4+j*7==n:
      keep=1
if keep==1:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n=int(input())
X=[]
for i in range(0,26):
    for j in range(0,15):
        if i*4+j*7<=100:
            X.append(i*4+j*7)
print('Yes' if n in X else 'No')

Submission status: Accepted

Solution code:
n=int(input())
for i in range(100//4):
    for j in range(100//7):
        if n==4*i+7*j:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

Solution code:
n = int(input())

aru = 0
for i in range(25):
    for j in range(14):
        if i*4 + j*7 == n:
            aru = 1
if aru == 1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
m = n//7
for i in range(m+1):
  if (n-i*7) % 4 == 0:
    print("Yes")
    exit()
print("No")

Submission status: Accepted

Solution code:
n=int(input())
a=-(-n//4)
ans = 'No'
if n%4==0:
    ans = 'Yes'
else:
    for i in range(a):
        if (n-4*i)%7==0:
            ans = 'Yes'
            break
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

for i in range(100):
  for j in range(100):
    if i * 4 + j * 7 == N:
      print('Yes')
      exit()

print('No')

Submission status: Accepted

Solution code:
N = int(input())

def exists():
    for seven in range(N):
        M = N - seven * 7
        if 0 <= M and M % 4 == 0:
            return True
    return False

print('Yes' if exists() else 'No')

Submission status: Accepted

Solution code:
n = int(input())
for i in range(100):
  for j in range(100):
    if 4*i+7*j == n:
        print('Yes')
        exit(0)
print('No')

Submission status: Accepted

Solution code:
N = int(input())
for i in range(1,26):
    for j in range(15):
        if N % (4*i + 7*j) == 0:
            print('Yes')
            exit()
for j in range(1,15):
    for i in range(26):
        if N % (4*i + 7*j) == 0:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

Solution code:
import itertools
N = int(input())
ans = "No"
for i,j in itertools.product(range(15),range(26)):
  if 7*i+4*j == N:
    ans ="Yes"

print(ans)

Submission status: Accepted

Solution code:
import sys

n = int(input())

for x in range(n//4+1):
    rest = n - 4 * x
    if rest % 7 == 0:
        print("Yes")
        sys.exit()

print("No")

Submission status: Accepted

Solution code:
n = int(input())
for i in range(0,26):
    for j in range(0,16):
        if 4*i+7*j==n:
            print('Yes')
            exit(0)
        if 4*i+7*j>n:
            break
print('No')

Submission status: Accepted

Solution code:
n = int(input())
y = False
for i in range(16):
    for j in range(26):
        if i*7 + j*4 == n:
            print("Yes")  
            y = True
            break
    if y:
        break
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for i in range(30):
    for j in range(20):
        if n == 4 * i + 7 * j:
            ans = 1
    if ans == 1:
        print("Yes")
        break
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
Max = N//7
result = 'No'
for i in range(Max+1):
	if (N-7*i)%4 == 0:
		result ='Yes'
		break
        
print(result)

Submission status: Accepted

Solution code:
n=int(input())%28
flag=0
for a in range(0,32,4):
  for b in range(0,35,7):
    if a+b==n:
      print("Yes")
      flag=1
      break
if flag==0:
	print("No")

Submission status: Accepted

Solution code:
N=int(input())
n=0
ans='No'
while 4*n <= N:
  if (N-4*n)%7==0:
    ans='Yes'
    break
  n += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
kouho = []
for i in range(26):
    for j in range(15):
        kouho.append(i*4+j*7)
if n in kouho:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys

N = int(input())

for i in range(0, 26, 1):
    for j in range(0, 21, 1):
        if i*4+j*7==N:
            print("Yes")
            sys.exit()

print("No")

Submission status: Accepted

Solution code:
n = int(input())

ans = 'No'

for i in range((n // 7)+1):
    if (n - 7 * i) % 4 == 0:
        ans = 'Yes'

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
s=0
flag=False
for i in range(int(n/4)+1):
    for j in range(int(n/7)+1):
        s=4*i+7*j
        if(s==n):
            flag=True

if(flag):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n=int(input())
can=False
for i in range(n//4+2):
    if (n - 4*i)%7==0:
        can=True
        break
if(can):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n=int(input())
for i in range(27):
  for j in range(27):
    if 4*i+7*j==n:
      print('Yes')
      exit()
print('No')

Submission status: Accepted

Solution code:
n=int(input())
for i in range(30):
  for j in range(30):
    if 4*i+7*j==n:
      print('Yes')
      exit()
      
print('No')

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
if N%7 == 0:
	print("Yes")
	exit()
	
for i in range(-(-N//7)):
	if (N - 7*i)%4 == 0:
		print("Yes")
		break
else:
	print("No")

Submission status: Accepted

Solution code:
N = int(input())
fmax = int(N/4)+1
smax = int(N/7)+1
for i in range(fmax+1):
  for j in range(smax+1):
    if (4*i+7*j) == N:
      print('Yes')
      exit()
print('No')

Submission status: Accepted

Solution code:
dollar = int(input())

can = False
for cakes in range(int(dollar / 4) + 1):
  for donuts in range(int(dollar /7) + 1):
    price = 4 * cakes + 7 * donuts
    if price == dollar:
      can = True
      break
    elif price > dollar:
      break
  if can == True:
    break
    
print("Yes" if can == True else "No")

Submission status: Accepted

Solution code:
N = int(input())
flag = False
for i in range(N//4+1):
    for k in range(N//7+1):
        if i*4 + k*7 == N:
            print('Yes')
            flag = True
            break
    if flag:
        break
else:
    print('No')

Submission status: Accepted

Solution code:
X = int(input())
ans = 0
cake = int(X/4)
donut = int(X/7)

for a in range(cake+1):
  for b in range(donut+1):
    total = a*4 + b*7
    if total == X:
      ans = 1

if ans >= 1:      
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
if int(input()) in [1,2,3,5,6,9,10,13,17]:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
import itertools
N = int(input())
flag = 0
for i, j in itertools.product(range(26),range(15)):
    if 4*i + 7*j == N:
        flag = 1
        break
print("Yes" if flag == 1 else "No")

Submission status: Accepted

Solution code:
N = int(input())
flag = 0
for i in range(26):
    for j in range(15):
        if 4*i + 7*j == N:
            flag = 1
            break
    else:
        continue
    break
print("Yes" if flag == 1 else "No")

Submission status: Accepted

Solution code:
n = int(input())

flag = False
for i in range(n // 4 + 1):
    for j in range(n // 7 + 1):
        if 4 * i + 7 * j == n:
            flag = True

print('Yes') if flag else print('No')

Submission status: Accepted

Solution code:
n = int(input())

for i in range(15):
    if n -7*i >= 0:
        if (n - 7*i)%4 == 0:
            print("Yes")
            exit()

print("No")

Submission status: Accepted

Solution code:
n = int(input())

for i in range(26):
    for j in range(15):
        if 4*i + 7*j == n:
            print("Yes")
            exit()

print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(N: int):
    for i in range(int(N/4)+1):
        for j in range(int(N/7)+1):
            if i*4+j*7 == N:
                print("Yes")
                exit()
    print("No")
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
x = n // 4
y = n // 7
ans = 0
for i in range(x+1):
    for j in range(y+1):
        if i*4 + j*7 ==n:
            ans += 1
if ans >=1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    N=int(input())
    for i in range(26):
        for j in range(15):
            if i*4+j*7==N:
                YesNo(1)
                exit()
    YesNo(0)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
N=int(input())
ma = N//4  #最大ma個まで買える
mb = N//7
for i in range(0,ma+1):
    for j in range(0,ma+1):
        if i*4 + j*7 == N:
            print("Yes")
            sys.exit()
print("No")

Submission status: Accepted

Solution code:
from sys import stdin
import sys

N = int(stdin.readline().rstrip())

for i in range(26):
    if N < 4 * i:
        break
    if (N - 4 * i) % 7 == 0:
        print("Yes")
        sys.exit()


print("No")

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    n = int(input())
    while n >= 0:
        if n%4 == 0:
            print('Yes')
            exit()
        else:
            n -= 7
    print('No')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())
for i in range(50):
    for j in range(50):
        if n==4*i+7*j:
            print("Yes")
            exit()

print("No")

Submission status: Accepted

Solution code:
N = int(input())

flg=False
for i in range(100//4 + 1):
    for j in range(100//7 + 1):
        if i==j==0:
            continue
        div = 4*i + 7*j
        if N%div==0:
            flg=True
ans = 'Yes' if flg else 'No'
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
count=0
for c in range(25):
    for d in range(15):
        if ((4*c)+(7*d))==N:
            count+=1
if count>=1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n=int(input())
for i in range((n//4)+1):
    for j in range((n//7)+1):
        if (i*4)+(j*7)==n:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

Solution code:
N = int(input())

M=N//7

flag=0
for i in range(M+1):
  #print(N-i*7)
  if (N-i*7)%4==0:
    flag=1
    break
else:
  if N==4 or N==7:
    flag=1

print('Yes' if flag==1 else 'No')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

def main():
    N = int(input())

    for i in range(100):
        for j in range(100):
            if N == i * 4 + j * 7:
                print("Yes")
                return
    print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
N=int(input())
POS=False
for i in range(math.floor(N/7)+1):
  if (N-7*i)%4==0:
    POS = True
if POS:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N=int(input())
tmp1=N//7
tmp2=N//4
for i in range(tmp1+1):
  for j in range(tmp2+1):
    if i*7+j*4==N:
      print('Yes')
      exit()
print('No')

Submission status: Accepted

Solution code:
N = int(input())

a_max = N // 4
b_max = N // 7

match = False
for i in range(a_max+1):
    for j in range(b_max+1):
        if i*4 + j*7 == N:
            match = True

if match:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
print('Yes' if any(i * 4 + j * 7 == N for i in range(100) for j in range(100)) else 'No')

Submission status: Accepted

Solution code:
N=int(input())
flg=False
for a in range(N//4+1):
  b=(N-4*a)/7
  if b >= 0 and b.is_integer():
    flg=True
    break
if flg:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N=int(input())
cnt=0
for i in range(0,N//4+1):
    for j in range(0,N//7+1):
        if (4*i)+(7*j)==N:
            cnt+=1
print("Yes" if cnt>0 else "No")

Submission status: Accepted

Solution code:
n = int(input())
ans = "No"
for i in range(25):
    t = n - 4*i
    if t < 0:
        continue
    if t % 7 == 0:
        ans = "Yes"
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
for i in range(26):
    for j in range(16):
        if 4 * i + 7 * j == n:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

Solution code:
n = int(input())
for i in range(30):
    for j in range(30):
        if n == 4*i+7*j:
            print("Yes")
            exit()

print("No")

Submission status: Accepted

Solution code:
N = int(input())
ans = 'No'
for i in range(N//4+1):
    for j in range(N//7+1):
        if N == 4*i + 7*j:
            ans = 'Yes'
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
res=0
for i in range((n//4)+1):
  for j in range((n//7)+1):
    if n==4*i+7*j:
      res=1
if res==1:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:

n = int(input())
a = 0
b = 0

for i in range(25):
    for j in range(14):
        if 4*i + 7*j == n:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

Solution code:
N = int(input())
flag = 0
if N%4==0 or N%7==0:
    flag=1
    print("Yes")
else:
    for i in range(7,N,7):
        if (N-i)%4==0:
            flag=1
            print("Yes")
            break
if flag==0:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
res =0
for i in range(25):
	for n in range(25):
		if i*4+n*7==N:
			res = 1
if res ==1 :
	print('Yes')
else:
	print('No')

Submission status: Accepted

Solution code:
icase=0
if icase==0:
    n=int(input())
    for dornt in range(0,n+1,7):
        for cake in range(0,n+1,4):
            if dornt+cake==n:
                print("Yes")
                break
        if dornt+cake==n:
            break
    if dornt+cake!=n:
        print("No")

Submission status: Accepted

Solution code:
N = int(input())

for i in range(0,N//4+1):
  for j in range(0,N//7+1):
    if 4*i+7*j == N :
      print('Yes')
      exit()
print('No')

Submission status: Accepted

Solution code:
N=int(input())
L=[]

for i in range(0,101,4):
    for j in range(0,101,7):
        t=i+j
        if t > 100: break
        L.append(t)
sets = set(L)

print('Yes' if N in sets else 'No')

Submission status: Accepted

Solution code:
N=int(input())

for i in range(26):
  for j in range(15):
    if N==i*4+j*7:

      print('Yes')
      exit()

print('No')

Submission status: Accepted

Solution code:
n=int(input())
List=[0]
for i in range(26):
  for j in range(15):
    if (4*i+j*7<=100):
      List.append(4*i+j*7)
    else:
      break
      
print("Yes" if (List.count(n)>0) else "No")

Submission status: Accepted

Solution code:
N=int(input())

ans='No'
i=0
while 7*i<=N:
    if (N-7*i)%4==0:
        ans='Yes'
    i+=1

print(ans)

Submission status: Accepted

Solution code:
import sys


N = int(input())
PRICE_CAKE = 4
PRICE_DOUGHNUT = 7

for i in range(0, int(N / 4) + 1):
    for j in range(0, int(N / 7) + 1):
        if PRICE_CAKE * i + PRICE_DOUGHNUT * j == N:
            print('Yes')
            sys.exit()
print('No')

Submission status: Accepted

Solution code:
N = int(input())
flag = False
for i in range(26):
    for j in range(15):
        if i*4 + j*7 == N:
            flag = True

if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# solution
import io

data = int(input())
print('Yes' if len([1 for i in range(26) if (data-4*i)%7==0 and data-4*i>=0])>0 else 'No')

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    res = False
    for i in range(100//4):
        for j in range(100//13):
            if 4*i + 7*j == N:
                res = True
    if res :
        print("Yes")
    else:
        print("No")
main()

Submission status: Accepted

Solution code:
n = int(input())
a = n//4
b = n//7
ans = 0
for i in range(a+1):
    for j in range(b+1):
        if 4*i+7*j == n:
            ans = 1
if ans == 1:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n = int(input())
a = n//4
b = n//7
flg = 0
for i in range(a+1):
    for j in range(b+1):
        if 4*i+7*j == n:
            flg = 1
            
print('Yes' if flg==1 else 'No')

Submission status: Accepted

Solution code:
x=int(input())
t=0
while x>=0:
  if x%7==0:
    t=1
  x-=4
if t==0:
  print('No')
else: print('Yes')

Submission status: Accepted

Solution code:
n = int(input())
a = n//4
b = n//7
cnt = 0
flg = 0
for i in range(a+1):
    for j in range(b+1):
        if 4*i+7*j == n:
            flg = 1
            
print('Yes' if flg==1 else 'No')

Submission status: Accepted

Solution code:
N = int(input())
flag = 0
for i in range(26):
    for j in range(16):
        if i * 4 + j * 7 == N:
            flag = 1
ans = 'Yes' if flag else 'No'
print(ans)

Submission status: Accepted

Solution code:
x=int(input())
t=0
while x>=0:
  if x%7==0:
    t=1
  x-=4
if t==0:
  print('No')
else: print('Yes')

Submission status: Accepted

Solution code:
N = int(input())
flag = False
for i in range(26):
    for j in range(14):
        if 4*i + j*7 == N:
            flag = True
            break
    if flag:
        break
print('Yes' if flag else 'No')

Submission status: Accepted

Solution code:
def resolve():
    n = int(input())
    for i in range(n, -1, -7):
        if i % 4 == 0:
            print("Yes")
            return
    print("No")


if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
N = int(input())
for i in range(26):
    for j in range(20):
        if N == i * 4 + j * 7:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

Solution code:
# ABC 105: B – Cakes and Donuts
n = int(input())
canDo = 'No'

for i in range(n // 4 + 1):
    for j in range(n // 7 + 1):
        if 4 * i + 7 * j == n:
            canDo = 'Yes'
            break

print(canDo)

Submission status: Accepted

Solution code:
N=int(input())
ans=False
for i in range(26):
    if ans==True:
        break
    for j in range(16):
        if 4*i+7*j==N:
            print('Yes')
            ans=True
            break
        else:
            continue
if ans==False:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())

sum = 0
flag = 0


a = int(N / 7)
re = N % 7

if re == 0 and N != 0:
    print('Yes')
    flag += 1
else:
    for i in range(a+1):
        sum = 7 * i
#        print(sum)
        while sum<N:
            sum += 4
#            print(sum)
            if sum == N:
                print('Yes')
                flag += 1
        if flag == 1:
            break

if flag == 0:
    print('No')

Submission status: Accepted

Solution code:
import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations
input = sys.stdin.readline
mod = 10**9 + 7
ns = lambda: input().strip()
ni = lambda: int(input().strip())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

n = ni()

for i in range(101):
    for j in range(101):
        if 4 * i + 7 * j == n:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

Solution code:
import sys
import os
import math

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    print('Yes' if len([1 for a in range(26) for b in range(26) if 4*a+7*b == N]) > 0 else 'No')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
for i in range(26):
    cost = i * 4
    if cost > N:
        print("No")
        exit()
    if not (N - cost) % 7:
        print("Yes")
        exit()

Submission status: Accepted

Solution code:
#!/usr/local/bin python
# -*- coding: utf-8 -*-
#
# ~/PycharmProjects/atcoder/B-CakesAndDounuts.py
#

n = int(input())

for i in range(n//7+1):
    for j in range(n//4+1):
        if i*7 + j*4 == n:
            print("Yes")
            exit()

print("No")

Submission status: Accepted

Solution code:
n=int(input())
ans=0
for i in range(n+1):
    for j in range(n+1):
        if 4*i+7*j==n:
            ans+=1
if ans>=1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
for i in range(100):
    for j in range(100):
        if 4*i + 7*j == N:
            print("Yes")
            break
    else:
        continue
    break
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
N = int(input())
ans = 0
def dfs(n):
    if n == N:
        print('Yes')
        sys.exit()
    if n > N:
        return

    dfs(n+4)
    dfs(n+7)

dfs(0)
print('No')

Submission status: Accepted

Solution code:
N = int(input())
cake = 4
donut = 7
ac = False
for i in range(25):
    for j in range(14):
        if N == (cake*i + donut*j):
            ac = True
            break
if ac:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())

b = 0

for i in range(26):
    for j in range(15):
        if 4*i + 7*j == N:
            b = 1
        else:
            continue

if b == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())

for i in range(0, n//4+1):
  if (n - i*4) % 7 == 0:
    print("Yes")
    exit()
print("No")

Submission status: Accepted

Solution code:
n = int(input())
for i in range(0, n//4 + 1):
  if (n - i*4) % 7 == 0:
    print("Yes")
    exit()
print("No")

Submission status: Accepted

Solution code:
n = int(input())
for i in range(26):
    for j in range(16):
        if 4*i + 7*j == n:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

Solution code:
n = int(input())

ans = 'No'
while n > 0:
    if n % 4 == 0:
        ans = 'Yes'
        break
    n -= 7
    if n == 0:
        ans = 'Yes'
        break

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
f = True

if n%7 == 0:
    print("Yes")
    f = False

while(n > 0)and(f):
    if(n%4 == 0):
        print("Yes")
        f = False
    n -= 7
if(f):
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
for i in range(N//4+1):
    if (N - 4*i)%7 == 0:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

Solution code:
N = int(input())
F = False
for i in range(25):
  for j in range(15):
    if 4*i+7*j == N:
      F = True
print("Yes" if F else "No")

Submission status: Accepted

Solution code:
n=int(input())
flag=True
for i in range(26):
    for j in range(16):
        if 4*i+7*j==n:
            print("Yes")
            flag=False
            exit()
if flag:
    print("No")

Submission status: Accepted

Solution code:
import math
a=int(input())
b_4 = math.ceil(a/4)
b_7 = math.ceil(a/7)

count =0
for i in range(b_4+1):
    for j in range(b_7+1):
        
        if (4*i+j*7) == a:
            count += 1
            break

if count>=1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
for i in range(n//4 + 1):
  if (n-4*i)%7 == 0:
    print('Yes')
    exit()
print('No')

Submission status: Accepted

Solution code:
n=int(input())
ans=0

for i in range(26):
    for j in range(15):
        if n==4*i+7*j:
            ans+=1
if ans==0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
n = int(input())
a = True
for i in range(n//4+1):
    if (n-i*4)%7==0:
        print('Yes')
        a = False
        break
if a:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())

for i in range(26):
  for j in range(15):
    if i * 4 + j * 7 == N:
      print('Yes')
      exit()
      
print('No')

Submission status: Accepted

Solution code:
N = int(input())

success = 0
for four in range(0, 26):
    for seven in range(0, 14):
        if four * 4 + seven * 7 == N:
            success = 1
if success:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N=int(input())
for i in range(26):
    for j in range(15):
        if 4*i+7*j==N:
            print("Yes")
            exit()
        else:
            continue
print("No")

Submission status: Accepted

Solution code:
N = int(input())

def func(N):
  for i in range(26):
    for j in range(15):
      if 4 * i + 7 * j == N:
        return True
  return False

if func(N):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N = int(input())
ans = 'No'
for i in range(26):
    for j in range(15):
        if N == i * 4 + j*7:
            ans = 'Yes'
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
n = N // 7
flag = 0
for i in range(n + 1):
  if (N - i*7) % 4 == 0:
    print("Yes")
    flag = 1
    break
if flag == 0:
  print("No")