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:
N = int(input())

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

Submission status: Accepted

Solution code:
N=int(input())

ans='Yes'
if N%4==0 or N%7==0 or N%11==0:
    pass
else:
    ans='No'
    while N>=4:
        N-=11
        if N%7==0 or N%4==0:
            ans='Yes'
            break
print(ans)

Submission status: Accepted

Solution code:
import math
import string


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):  # リストに重複した要素があるか判定（要素にリストがある場合）
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


#a, b, c, d = map(int, input().split())
#print(a, b, c, d)
#x = ((a-c)**2+(b-d)**2)**0.5
# print(x)
n = int(input())
# print(divisor(n))
for i in range((n//4)+1):
    for j in range((n//7)+1):
        if 4*i+7*j == n:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

dp = ["No"] * 101
dp[4] = "Yes"
dp[7] = "Yes"
for i in range(8, 101):
    if dp[i - 4] == "Yes":
        dp[i] = "Yes"
    elif dp[i - 7] == "Yes":
        dp[i] = "Yes"

print(dp[n])

Submission status: Accepted

Solution code:
n = int(input())
t = 0
for i in range(30):
    if (n - i * 4) % 7 == 0 and i*4 <= n:
        t = 1
if t == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())

flg = False
for a in range(N//4 + 1):
  for b in range(N//4 + 1):
    if (N - 4*a - 7*b) == 0:
      print('Yes')
      flg = True
      break
  else:
    continue
  break
  
if flg == False:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
is_just = False
for x in range(25):
    for y in range(15):
        if 4 * x + 7 * y == N:
           is_just = True
           break
if is_just:
    print('Yes')
else:
    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 4*i + 7*j == n:
            ans = 'Yes'

print(ans)

Submission status: Accepted

Solution code:
n=int(input())

while n>3:
    if n%7==0 or n%4==0:
        print("Yes")
        break
    n-=4
if n<4:
    print("No")

Submission status: Accepted

Solution code:
print("Yes" if [4*x+7*y for y in range(101) for x in range(101)].count(int(input())) else "No")

Submission status: Accepted

Solution code:
n = int(input())
count = 0
for i in range(n+1):
  for j in range(n+1):
    if 4*i + 7*j == n:
      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):
  for j in range(n//7+1):
    if 4*i+7*j==n:
      print('Yes')
      exit()
print('No')

Submission status: Accepted

Solution code:
n=int(input())

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
import sys


CAKE = 4
DOUNAT = 7


def check_amount(i, j, n):
    return i*4 + j*7 == n


n = int(input())
count = 0
for i in range(int(n/CAKE+1)):
    for j in range(int(n/DOUNAT+1)):
        if check_amount(i, j, n):
            print('Yes')
            sys.exit()
print('No')

Submission status: Accepted

Solution code:
N = int(input()) # 1~100ドル

CAKE = 4
DONUTS = 7

ans = "No"
for i in range(N//CAKE + 1):
  for j in range(N//DONUTS + 1):
    total = CAKE*i + DONUTS*j
    if total == N:
      ans = "Yes"
      break

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

cnt=0
if N<4:
    print('No')
    cnt=1
else:
    t=int(N/7)
    for i in range(0,t+1):
        if (N-(7*i))%4==0:
            print('Yes')
            cnt=1
            break
        else:
            pass
    if cnt==0:
        print('No')

Submission status: Accepted

Solution code:
N = int(input())
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()
        if i * 4 + j * 7 > N :
            break
print("No")

Submission status: Accepted

Solution code:
n = int(input())
i = 0
for i in range(26):
    if 4*i > n:
        print("No")
        break
    elif (n-4*i)%7==0:
        print("Yes")
        break
    else:
        continue

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
res = 0
for a in range (0,N//4 + 1):
    for b in range(0,N//7 + 1):
        total = 4 * a + 7 * b
        if total == N:
            res += 1
if res > 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())

ans = False
for c in range(101):
    for d in range(101):
        if (4 * c) + (7 * d) == n:
            ans = True
            break

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

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n=INT()
    flg=0
    for i in range(n//7+1):
        if (n-i*7)%4==0:
            flg=1
    if flg==1:
        print('Yes')
    else:
        print('No')
if __name__ == '__main__':
    do()

Submission status: Accepted

Solution code:
n=int(input())

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

Submission status: Accepted

Solution code:
n = int(input())

max4 = n // 4 + 1
max7 = n // 7 + 1

check = False
for i in range(max4):
    for j in range(max7):
        s = 4 * i + 7 * j
        if s == n:
            check = True
            break

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

Submission status: Accepted

Solution code:
N = int(input())
OK = False
for i in range(100//4+1):
    for j in range(100//7+1):
        if N == 4 * i + 7 * j:
            OK = True

if OK:
    print('Yes')
else:
    print('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:
      print('Yes')
      flag = 1
  if flag == 1:
    break
    
    
if flag == 0:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

a = n // 4
b = n // 7

print("Yes" if any([(n - 4*i) % 7 == 0 for i in range(a+1)] + [(n - 7*i) % 4 == 0 for i in range(b+1)]) else "No")

Submission status: Accepted

Solution code:
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
import itertools
from functools import *
from itertools import permutations,combinations,groupby
import sys
import bisect
import string
import math
import time
import random
def Golf():
    *a,=map(int,open(0))
def S_():
    return input()
def IS():
    return input().split()
def LS():
    return [i for i in input().split()]
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def NI(n):
    return [int(input()) for i in range(n)]
def NI_(n):
    return [int(input())-1 for i in range(n)]
def StoI():
    return [ord(i)-97 for i in input()]
def ItoS(nn):
    return chr(nn+97)
def LtoS(ls):
    return ''.join([chr(i+97) for i in ls])
def GI(V,E,Directed=False,index=0):
    org_inp=[]
    g=[[] for i in range(n)]
    for i in range(E):
        inp=LI()
        org_inp.append(inp)
        if index==0:
            inp[0]-=1
            inp[1]-=1
        if len(inp)==2:
            a,b=inp
            g[a].append(b)
            if not Directed:
                g[b].append(a)
        elif len(inp)==3:
            a,b,c=inp
            aa=(inp[0],inp[2])
            bb=(inp[1],inp[2])
            g[a].append(bb)
            if not Directed:
                g[b].append(aa)
    return g,org_inp
def GGI(h,w,search=None,replacement_of_found='.',mp_def={'#':1,'.':0}):
#h,w,g,sg=GGI(h,w,search=['S','G'],replacement_of_found='.',mp_def={'#':1,'.':0}) # sample usage
    mp=[1]*(w+2)
    found={}
    for i in range(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[1]+[mp_def[j] for j in s]+[1]
    mp+=[1]*(w+2)
    return h+2,w+2,mp,found
def bit_combination(k,n=2):
    rt=[]
    for tb in range(n**k):
        s=[tb//(n**bt)%n for bt in range(k)]
        rt+=[s]
    return rt
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['YES','NO']

mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
u_alp=string.ascii_uppercase
ts=time.time()
#sys.setrecursionlimit(10**7)
input=lambda: sys.stdin.readline().rstrip()
 
def ran_input():
    import random
    n=random.randint(4,16)
    rmin,rmax=1,10
    a=[random.randint(rmin,rmax) for _ in range(n)]
    return n,a

show_flg=False
show_flg=True

n=I()
t=[0]*102
for i in range(100):
    for j in range(100):
        t[min(101,4*i+7*j)]=1

print(['No','Yes'][t[n]])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
import sys

N = int(input())
x = range(25 + 1)
y = range(14 + 1)
for i, j in itertools.product(x, y):
  if i * 4 + j * 7 == N:
    print('Yes')
    sys.exit()
else:
  print('No')

Submission status: Accepted

Solution code:
print('YNeos'[int(input()) in [1,2,3,5,6,9,10,13,17]::2])

Submission status: Accepted

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

print("No")

Submission status: Accepted

Solution code:
import sys
n = int(input()) 
i = 0 
j = 0
while(i < 100):
    j = 0
    while(j < 100):
        if 7* i + 4 * j == n:
            print("Yes")
            sys.exit()
        j+= 1
        
    i+= 1

print("No")

Submission status: Accepted

Solution code:
#105_B
N=int(input())
flg=False
for i in range(0,N//7+1):
    x=N
    x=x-7*i
    if x%4==0:
        flg=True
        break
print('Yes' if flg else 'No')

Submission status: Accepted

Solution code:
import math
n = int(input())
for i in range(n):
    for j in range(n):
        if i*4+j*7 == n:
            print("Yes")
            quit()
        if i*4+j*7 >= n:
            break
print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def check(n):
    for i in range( n // 7 + 1 ):
        for j in range( n // 4 + 1 ):
            if (i*7 + j*4) == n:
                print("Yes")
                return

    print("No")
    return


n = int(input().strip())
check(n)

Submission status: Accepted

Solution code:
n = int(input())
lista = [4*i for i in range((100//4)+1)]
listb = [7*i for i in range((100//7)+1)]
flag = False
for i in lista:
    for j in listb:
        if i+j == n:
            flag = True
if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
n = int(input())
for x in range(26):
    for y in range(15):
        if 4*x + 7*y == n:
            print("Yes")
            sys.exit()

print("No")

Submission status: Accepted

Solution code:
n = int(input())
cnt = 0
for k in range(n):
    for j in range(n):
        if 4*k+7*j == n:
            cnt += 1
if n < 4 or cnt == 0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

print("No")

Submission status: Accepted

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

def main():
    n = int(input())
    ans = "No"
    for i in range((n // 4) + 1):
        for j in range((n // 7) + 1):
            if 4 * i + 7 * j == n:
                ans = "Yes"
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
c = (N + (4 - N%4)) / 4
d = (N + (7 - N%7)) / 7
flag = False
 
for i in range(int(c)):
  for j in range(int(d)):
    total = 4*i + 7*j
    if total == N:
      flag = True
      
if flag:
  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 (i*4 + j*7) == N:
      ans = "Yes"
      break
print(ans)

Submission status: Accepted

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

if cnt == N//4 + 1:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
ans = False

for i in range(100):
    for j in range(100):
        if 4 * i + 7 * j == N:
            ans = True
    
print('Yes' if ans else 'No')

Submission status: Accepted

Solution code:
n = int(input())
if n %4 == 0:
	print ("Yes")
	exit()
if n % 7 == 0:
	print ("Yes")
	exit()

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

Submission status: Accepted

Solution code:
n = int(input())
flag = False
for a in range(n//4 + 4):
    for b in range(n//7 + 7):
        if a*4 + b*7 == n:
            flag = True
            break
if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

for x in range(35):
	if (n - 7*x) % 4 == 0 and n >= 7*x:
		print("Yes")
		break
else:
	print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def main():
    N = int(input())
    reslut = 'No'
    for i in range(N // 4 + 1):
        for j in range(N // 7 + 1):
            if N == i * 4 + j * 7:
                reslut = 'Yes'
    print(reslut)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N=int(input())
uho=0
for i in range(N//7+1):
  for t in range((N-7*i)//4+1):
    if 7*i+4*t==N:
      uho=1
if uho==1:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import math
n = int(input())
counter = False
#for n in range (0,100):
for i in range (math.ceil((n+1) / 4) ):
  for j in range (math.ceil((n+1) / 7) ):
    #print(n, i,j)
    if i*4 + j*7 == n:
      counter = True
if counter == True:
  print("Yes")
else:
  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())

flag = 0

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

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

Submission status: Accepted

Solution code:
try:
  N = int(input())
  for a in range(100):
      for b in range(100-a):
          if 4*a+7*b==N:
              print('Yes')
              exit()
  print('No')
except EOFError:
  pass

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
a = 4
b = 7

max_a_loop , _ = divmod(N, a)
max_b_loop , _ = divmod(N, b)
# print(max_a_loop)
# print(max_b_loop)
total = 0
ans = "No"

for i in range(max_a_loop+1):
    total = a*i
#     print(total)

    if total == N:
        ans = "Yes"
    for j in range(max_b_loop+1):
        total += b*j
#         print(total)

        if total == N:
            ans = "Yes"
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

flag = 0
for i in range(25):
    for j in range(12):
        if (4*i + 7*j) == N:
            flag = 1
        else:
            flag = flag

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    limit = int(input())
    result = False
    for i in range(26):
        for j in range(15):
            if 4 * i + 7 * j == limit:
                result = True
                break
    if result:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())

dp = [0] * (n + 1)
dp[0] = 1
for i in range(n):
  if n >= i + 4 and dp[i] >= 1:
    dp[i + 4] = 1
  if n >= i + 7 and dp[i] >= 1:
    dp[i + 7] = 1

if dp[n] == 0:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
def resolve():
    n = int(input())
    l = list()
    for i in range(26):
        for j in range(16):
            l.append(i*4 + j*7)

    if n in l:
        print("Yes")
    else:
        print("No")

resolve()

Submission status: Accepted

Solution code:
N=int(input())

n=100
f=0

for i in range(n):
    for j in range(n):
        if 4*i+7*j==N:
            f=1
            break
            
if f==1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n =int(input())
a=int(n/4)+1
b=int(n/7)+1

total=0
count=0
for i in range(a):
    for j in range(b):
            total=4*i+7*j
            if total==n:
                count+=1
                
if count>=1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n=int(input())
for i in range(0,26):
	for j in range(0,26):
		if n == 4*i+7*j:
			print('Yes')
			exit(0)
		else:
			pass
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())
if N%4==0 or N%7==0:
  print('Yes')
else:
  while 7<N:
    N-=7
    if N%4==0:
      print('Yes')
      break
  else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
cake = 4
donaut = 7
N = int(input())
count = 0

for i in range(0, 20):
	for k in range(0, 20):
		if N == cake * i + donaut * k:
			count = 1
			break

if count == 0:
	print('No')
else:
	print('Yes')

Submission status: Accepted

Solution code:
import sys
n = int(input())
cake = 0
for i in range(n//4 + 1):
    don = 0
    for j in range(n//7 + 1):
        
        if cake + don == n:
            print("Yes")
            sys.exit()
        don += 7
    cake += 4
print("No")

Submission status: Accepted

Solution code:
N = int(input())

combi = False
for i in range(N//4+1):
    if (N - 4 * i) % 7 == 0:
        combi = True
if combi:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())

no_flag = True

for i in range((N//4)+1):
    if no_flag == False:
        break
    for j in range((N//7)+1):
        if no_flag == False:
            break
        if (4*i+7*j) == N:
            print("Yes")
            no_flag = False
            
if no_flag == True:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())

combi = []

for i in range(26): # 4 * 25 = 100
    for j in range(16): # 7 * 15 = 105
        combi.append((4 * i) + (7 * j))
       
if N in combi:
    print('Yes')
else :
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
c=False
i=0
while(i<(n//4+1)):
  if (n-4*i)%7==0:
    print("Yes")
    exit()
  else:
    i+=1
print("No")

Submission status: Accepted

Solution code:
N = int(input())
for f in range(0,26):
    for s in range(0,15):
        if (4*f)+(7*s)==N:
            print('Yes')
            break
        elif (f==25) and (s==14):
            print('No')
    else:
        continue
    break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
flg=False

for i in range(0, 26):
    for j in range(0, 16):
        if(4*i+7*j==n):
            flg = True
            break
print("Yes" if flg else "No")

Submission status: Accepted

Solution code:
N = int(input())

while N >= 0:
    if N % 4 == 0:
        print("Yes")
        exit()
    N -= 7
print("No")

Submission status: Accepted

Solution code:
N = int(input())
sum=0
count=0
for a in range(26):
    for b in range(15):
        sum = 4*a + 7*b
        if N == sum:
            count+=1
if count>0:
    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 4*i + 7*j == n:
            print('Yes')
            exit()

print('No')

Submission status: Accepted

Solution code:
n = int(input())

for cake in range(27):
    for donut in range(16):
        val = cake * 4 + donut * 7
        if val == n:
            print('Yes')
            exit()

print('No')

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
import itertools
import sys

"""
1個4ドルのケーキX個と1個7ドルのドーナツY個
合計Nドルとなる買い方があるときはyes、逆はno

1<= N <=100
4 * X + 7 * Y = N
0<= X <= 25, 0<= Y <= 14
"""

N = int(input())
X = list(range(26))
Y = list(range(15))

for i, j in list(itertools.product(X, Y)):
  if 4 * i + 7 * j == N:
    print('Yes')
    sys.exit()
print('No')

Submission status: Accepted

Solution code:
n=int(input())

flag=False

while(n>0):
    if n%7==0:
        flag=True
        break
    n-=4
    if n==0:
        flag=True

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

Submission status: Accepted

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

print('No')

Submission status: Accepted

Solution code:
n = int(input())

for i in range(n//7+1):
  for j in range((n-7*i)//4+1):
    if n == 7*i + 4*j:
      print('Yes')
      break
  else:
    continue
  break
else:
  print('No')

Submission status: Accepted

Solution code:
n=int(input())
ans="No"
a=0

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
n=int(input())
ans="No"
a=0

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
n = int(input())
ans = 0
for i in range(n//7+1):
    if (n - i*7) % 4 == 0: ans += 1
print("Yes" if ans > 0 else "No")

Submission status: Accepted

Solution code:
n = int(input())
for i in range(100):
    if n - 7 * i >= 0 and (n - 7 * i) % 4 == 0:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

Solution code:
N = int(input())
cnt = 0
for i in range(100+1):
    if 4*i>N:
        break
    for j in range(100+1):
        if 7*j>N:
            break
        if 4*i+7*j==N:
            cnt += 1

if cnt>0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())

counter = 0
max = int(n/4) + 1
for i in range(max):
  for ii in range(max):
    if(n == i*7 + ii*4):
      counter = counter +1

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

Submission status: Accepted

Solution code:
n = int(input())

counter = 0
max = 25
for i in range(max):
  for ii in range(max):
    if(n == i*7 + ii*4):
      counter = counter +1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

c = 0

ans = 'No'

for i in range(15):
    for j in range(26):
        c = 4 * j + 7 * i
        if n == c:
            ans = 'Yes'
            break
print(ans)

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:
a=int(input())
print("Yes" if [4*x+7*y for x in range(101) for y in range(101)].count(a) else "No")

Submission status: Accepted

Solution code:
n=int(input())
print("Yes" if [4*x+7*y for y in range(101) for x in range(101)].count(n) else "No")

Submission status: Accepted

Solution code:
N = int(input())
x = 0
flg = 0

while N - 4 * x >= 0:
	if (N - 4 * x) % 7 == 0:
		flg = 1
		break
	x += 1
	
if flg:
	print("Yes")
else:
	print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import heapq

N = int(input())
h = [4, 7]
heapq.heapify(h)

while True:
    n = heapq.heappop(h)

    if n > N:
        print('No')
        break

    if n == N:
        print('Yes')
        break

    heapq.heappush(h, n + 4)
    heapq.heappush(h, n + 7)

Submission status: Accepted

Solution code:
N = int(input())

ans =0

for i in range(N):
    for j in range(N):
        if (i*4 + j*7)== N:
            ans +=1
            break
        if(ans==1):
            break
    


if ans !=0:
    print("Yes")
else:
    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 4 * i + 7 * j == n:
            ans = "Yes"
            break
print(ans)

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(0)
print("No")