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(26):
  for j in range(15):
    if 4 * i + 7 * j == N:
      print('Yes')
      exit(0)
print('No')

Submission status: Accepted

Solution code:
n = int(input())
cnt = 0
for i in range(100):
    if 4*i>n:
        break
    for j in range(100):
        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())
a = 0
for i in range(n+1):
    for j in range(n+1-i):
        if i*4 + j*7 == n:
            a += 1
if a >= 1:
    print("Yes")     
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input().strip())
for i in range(0, 26, 1):
    cake = 4 * i
    for j in range(0, 16, 1):
        donut = 7 * j
        if cake + donut == n:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

combi = False
for i in range(N//4+1):  # N=40に対し、ケーキは0~10個のいずれか
    for j in range(N//7+1):  # N=40に対し、ドーナツは0~5個のいずれか
        if 4 * i + 7 * j == N:
            combi = True
            break
if combi:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

for i in range(100): #2重ループでケーキ，ドーナツの数を1個ずつ変えていってnドルになった時に終了させる
    for j in range(100):
        if i * 4 + j * 7 == n:
            print("Yes")
            exit()

print("No")

Submission status: Accepted

Solution code:
N = int(input())
ans = "No"

for a in range (25):
  for b in range (14):
    if 4*a + 7*b == N:
      ans = "Yes"

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:
def solve(n):
	if n == 0:
		return True
	if n < 0:
		return False
	return (False or solve(n-4) or solve(n-7))

n = int(input())
print('Yes' if solve(n) else '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()
else:
  print("No")

Submission status: Accepted

Solution code:
n = int(input())

for i in range(0, int(100/7)+1):
   x = n - i * 7
   if (x == 0 or x % 4 == 0):
      print('Yes')
      exit()
   elif (x < 4):
      break
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:
# -*- coding: utf-8 -*-
n = int(input())

flag = 0
for cake in range(100):
    for donuts in range(100):
        if 4 * cake + 7 * donuts == n:
            flag = 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

is_Yes = False
if N % 4 == 0 or N % 7 == 0:
    print('Yes')
else:
    is_Yes = False
    for i in range(4, N+1, 4):
        if (N - i) % 7 == 0:
            is_Yes = True
            break
    if is_Yes:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
N = int(input())
print("YNeos"[N not in [a+b for a in range(0,N+1,4) for b in range(0,N+1,7)]::2])

Submission status: Accepted

Solution code:
N = int(input())
if N < 4:
  print("No")
elif N % 4 == 0 or N % 7 == 0 or N % 11 == 0:
  print("Yes")
else:
  ans = "No"
  for _ in range(N // 4):
    if N % 7 == 0:
      ans = "Yes"
      break
    else:
      N -= 4

  print(ans)

Submission status: Accepted

Solution code:
N = int(input())

ans = "No"

while N >= 0:
  if N % 4 == 0:
    ans = "Yes"
    break
  else:
    N = N - 7
    
    
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

N = int(input())

Cake = 4
Donuts = 7

ans = 'No'
for i in range(N//4 + 1):
    for j in range(N//7 + 1):
        if N == Cake * i + Donuts * j:
            ans = 'Yes'
            break

print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
flag = False
while True:
    if N % 4 == 0 or N == 0:
        flag = True
        break
    if N < 4:
        break
    N -= 7
if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
print("Yes" if any([(N - 4*i) %
                    7 == 0 for i in range((N+3)//4 + 1)]) else "No")

Submission status: Accepted

Solution code:
import sys
n=int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

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

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

Submission status: Accepted

Solution code:
x = 4
y = 7

a=int(input())

ans = 'No'

for i in range(20):
  for j in range(14):
    if (x * i) + (y * j) == a:
      ans = 'Yes'

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

list_aaa =[]

for i in range(26):
    for j in range(26):
        list_aaa.append((i*4)+(j*7))
list_aaa = sorted(list_aaa)

# print(list_aaa)

if N in list_aaa:
    print("Yes")
else:
    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):
        l.append(i + j)

if n in l:
    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(26):
    for j in range(15):
        if 4*i + 7*j == n:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

Solution code:
import sys
bbn=1000000007
	
#+++++
		
def main():
	a = int(input())
	for i in range(16):
		if 7 * i <= a and (a - (7*i))%4==0:
			return 'Yes'
	return 'No'
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

Solution code:
n = int(input())

#n=4*x+7y

for x in range(n):
    memo = n-4*x
    if memo%7 == 0 and memo//7 >= 0:
        print("Yes")
        break
    elif x==n-1:
        print("No")

Submission status: Accepted

Solution code:
n = int(input())

#cake   : 4 dollar
#donuts : 7 dollar

cnt = "No"

if n % 4 == 0:
  cnt = "Yes"
  
if n % 7 == 0:
  cnt = "Yes"
  
# 7 * 14 = 98
for i in range(1,14):
  if( 7 * i > n ):
    break
  else:
    if( (n-7*i) % 4 == 0):
      cnt = "Yes"
      break
      
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())

flag = False

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

Submission status: Accepted

Solution code:
import math
import heapq
import sys
from collections import Counter
import datetime
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN

#N,K=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
#x=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき

N=int(input())

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

Submission status: Accepted

Solution code:
import queue

ok_list = set()

q = queue.Queue()
q.put(0)
while not q.empty():
    current = q.get()
    for i in [4, 7]:
        n = current + i
        if n > 100:
            continue
        elif n in ok_list:
            continue
        else:
            ok_list.add(n)
            q.put(n)

n = int(input())
if n in ok_list:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
a = "No"
b = 1
for i in range(21) :
    for j in range(15) :
        if 4 * i + 7 * j == N :
            a = "Yes"
            b = 0
            break
    if b == 0 :
        break
print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

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

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

n = int(sys.stdin.buffer.readline())
ok=False

for i in range(n + 100):
    for j in range(n + 100):
        ok  |= i * 4 + j * 7 == n
if ok:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys

cand = set()
for i in range(0, 20+1, 4):
    for j in range(0, 20-i+1, 7):
        cand.add(i + j)

n = int(sys.stdin.readline().rstrip())

def main():
    return 'Yes' if n in cand or n >= 21 else 'No'

if __name__ == '__main__':
    ans = main()
    print(ans)

Submission status: Accepted

Solution code:
import sys

cand = set()
for i in range(0, 100+1, 4):
    for j in range(0, 100-i+1, 7):
        cand.add(i + j)

n = int(sys.stdin.readline().rstrip())

def main():
    return 'Yes' if n in cand else 'No'

if __name__ == '__main__':
    ans = main()
    print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
N = int(input())

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

Submission status: Accepted

Solution code:
from math import ceil

N = int(input())
is_possible = False

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

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

Submission status: Accepted

Solution code:
n = int(input())
lst_4 = [x for x in range(4, 101, 4)]
lst_7 = [x for x in range(7, 101, 7)]
lst = []
for i in lst_4:
    for j in lst_7:
        lst.append(i)
        lst.append(j)
        lst.append(i + j)

ans = [x for x in lst if x <= 100]
print('Yes' if n in ans else 'No')

Submission status: Accepted

Solution code:
N = int(input())
cake = N // 4
donuts = N // 7
calcs = False
for i in range(cake + 1):
  for j in range(donuts + 1):
    s = i * 4 + j * 7
    if s == N:
      calcs = True
      break
print('Yes' if calcs is True else 'No')

Submission status: Accepted

Solution code:
N=int(input())

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

Submission status: Accepted

Solution code:
n = int(input())
dp = [False] * (n+5)
dp[0] = True

for i in range(len(dp)):
    if i < 4:
        continue
    elif dp[i-4] == True:
        dp[i] = True

    if i < 7:
        continue
    elif dp[i-7] == True:
        dp[i] = True

#print(dp)
if dp[n]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

n = int(input())

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

print("No")

Submission status: Accepted

Solution code:
N=int(input())
c=N//4
d=N//7
flg=False
for i in range(c+1):
  for j in range(d+1):
    if 4*i + 7*j == N:
      flg=True
      break
print("Yes" if flg else "No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# B Cakes and Donuts

# input
N = int(input())

cake_max = N // 4
donut_max = N // 7

res = 'No'

for cake in range(cake_max+1):
    if cake * 4 == N:
        res = 'Yes'
        break
    for donut in range(donut_max+1):
        if (N - cake*4) % 7 == 0:
            res = 'Yes'
            break

print(res)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
N = int(input())

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

print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ans = 'No'

n = int(input())

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())

flag = False
for i in range(n//7+1):
    if (n-i*7)%4 == 0:
        flag = True
        break

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

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
cost_list = np.array((4,7))
dp = np.ones(N+1, dtype=np.bool) * False
dp[0] = True
for i in range(1,N+1):
    for j in range(len(cost_list)):
        cost = cost_list[j]
        if i - cost >= 0 and dp[i-cost]:
            dp[i] = True
            break

res = "Yes" if dp[N] else "No"

print(res)

Submission status: Accepted

Solution code:
N =int(input())

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

print('No')

Submission status: Accepted

Solution code:
N = int(input())

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

print("No")

Submission status: Accepted

Solution code:
N = int(input())

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

print(ans)

Submission status: Accepted

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

for i in range(0,n+1,4):
    for j in range(0,n+1,7):
        if i+j == n:
            ans = "Yes"
            
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

for y in range(13):
    x = N - 7 * y
    if x >= 0 and x % 4 == 0:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

Solution code:
import math
N = int(input())
for i in range(16):
    res = N - 7 * i
    if res < 0:
        break
    if res % 4 == 0:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

Solution code:
no_list = [1,2,3,5,6,9,10,13,17]

N = int(input())

if N in no_list:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
N = int(input())

flag = 0

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

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

Submission status: Accepted

Solution code:
#coding:utf-8
n = int(input())

#全探索
for i in range(1 + n//4):
    for j in range(1 + n//7):
        if 4*i + 7*j == n:
            print('Yes')
            exit()

print('No')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
for i in range(0, N + 1, 4):
    total = i
    for j in range(0, N + 1, 7):
        total += j
        if total == N:
            print("Yes")
            sys.exit()
        elif total > N:
            break
print("No")

Submission status: Accepted

Solution code:
N = int(input())

for i in range(0, 26):
        if 4 * i > N:
                break
        for j in range(0, 16):
                if 4 * i + 7 * j > N:
                        break
                if 4 * i + 7 * j == N:
                        print("Yes")
                        exit()
print("No")

Submission status: Accepted

Solution code:
n=int(input())

for i in range(20):
  if (n-7*i)<0:
    print("No")
    break
  elif (n-7*i)%4==0:
    print("Yes")
    break

Submission status: Accepted

Solution code:
N=int(input())

is_buy = 'No'
for a in range((N//4)+1):
    for b in range((N//7)+1):
        if 4*a + 7*b == N:
            is_buy = 'Yes'
            break
print(is_buy)

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())
for i in range(20):
	for j in range(25):
		if(i == 0 and j == 0):
			continue
		if((i*7+j*4) == N):
			print("Yes")
			exit()
print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

"""
sample = []
for i in range(100):
    for j in range(100):
        sample.append(4*i + 7*j)

print(sample)
print("---")
print(set(sample))
"""

a = int(input())

sample = [0, 4, 7, 8, 11, 12, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200]

if a in sample:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n=int(input())
i=0
while True:
    j=0
    if i*4+j*7>n:
        break
    while True:
        if i*4+j*7==n:
            print("Yes")
            exit()
        j+=1
        if i*4+j*7>n:
            break
    i+=1

print("No")

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    while n >= 0:
        f = n % 4
        if f == 0:
            return "Yes"
        n -= 7
    return "No"


print(main())

Submission status: Accepted

Solution code:
n = int(input())

flag = False
for i in range(0,26):
    for j in range(0, 16):
        if 4 * i + j * 7 == n:
            flag = True
            break

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

Submission status: Accepted

Solution code:
#4と、7
n =int(input())

for i in range(16):
  s = n - (i*7)
  if s < 0:
    break
  if s%4==0:
    print("Yes")
    exit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

A = 4
B = 7
max_num = N // 4 + 1
res = "No"
for i in range(max_num + 1):
    for j in range(max_num - i):
        if (A * i + B * j) == N:
            res = "Yes"
            break

print(res)

Submission status: Accepted

Solution code:
n = int(input())

tot = 0
count = 0
for i in range(100):
  for j in range(100):
    tot = 4*i + 7*j
    if n == tot:
      print("Yes")
      count = 1
      exit()
if count != 1:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

flg = False
for a in range(int(N / 4 + 1)):
    for b in range(int(N / 7 + 1)):
        if a * 4 + b * 7 == N:
            flg = True

print("Yes" if flg else "No")

Submission status: Accepted

Solution code:
N = int(input())

flg = False
for a in range(N):
    for b in range(N):
        if a * 4 + b * 7 == N:
            flg = True

print("Yes" if flg 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:
from sys import exit

N = int(input())

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

Submission status: Accepted

Solution code:
import sys
n=int(input())
while(n>=0):
    if(n%4==0):
        print("Yes")
        sys.exit()
    else:
        n-=7
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(0)
print("No")

Submission status: Accepted

Solution code:
n = int(input())

ans = "No"
while n >= 0:
    if n%11 == 0 or n%4 == 0 or n%7 == 0:
        ans = "Yes"
        break

    n -= 4

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
cake = 4
donut = 7
flag = False
for i in range(25):
  for j in range(25):
    num = n - i*cake - j*donut
    if num == 0:
      flag = True
if flag:
  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()
print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
def devide(n):
  if n < 4:
    return False
  elif n % 4 == 0:
    return True
  elif n % 7 == 0:
    return True
  else:
    return devide(n - 4) or devide(n - 7)

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
#0<cake<=25 0<donatu<=14
#4*cake+7*donatu==N
buy = False
break_flag  = False

for cake in range(25):
    for donatu in range(14):
        if 4*cake+7*donatu==N:
            buy = True
            break_flag=True
            break
    
    if break_flag:
        break

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

Submission status: Accepted

Solution code:
N = int(input())

range_cakes = range((N//4)+1)
range_donuts = range((N//7)+1)

flag = False
for i in range_cakes:
  for j in range_donuts:
    if N - 4 * i - 7 * j == 0:
      flag = True
if flag:
	print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
N = int(input())

m = 0
for i in range(26):
    for j in range(15):
        m = 4 * i + 7 * j
        if N == m:
            print("Yes")
            sys.exit()
print("No")

Submission status: Accepted

Solution code:
a = range(26)
b = range(15)
n = int(input())
ans = "No"

for i in a:
    for j in b:
        if 4*i + 7*j == n:
            ans = "Yes"

print(ans)

Submission status: Accepted

Solution code:
[print("Yes" if any(cake * 4 + donut * 7 == n for donut in range(n // 7 + 1) for cake in range(n // 4 + 1)) else "No") for n in [int(input())]]

Submission status: Accepted

Solution code:
n = int(input())
# if n % 4 == 0 or n % 7 == 0:
#   print("Yes")
# elif n % (4 + 7) == 0:
#   print("Yes")
# elif n % 4 % 7 == 0 or n % 7 % 4 == 0:
#   print("Yes")
# else:
#   print("No")
ans = "No"
for i in range(0,n//4 + 1):
  for j in range(0,n//7 + 1):
    if 4 * i + 7 * j == n:
      ans = "Yes"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

if n in [1, 2, 3, 5, 6, 9, 10, 13, 17]:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
n = int(input())
for cake in range(26):
    for donuts in range(15):
        if cake * 4 + donuts * 7 == n:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

q,r = divmod(n, 7)

res = 0
for i in range(n):
  for j in range(n):
    t = 7*i + 4 *j 
    if t == n:
      res += 1

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

Submission status: Accepted

Solution code:
n = int(input())
string = "No"
for i in range(n+1):
        for j in range(n+1):
            if n == 4*i + 7*j :
                string = "Yes"
                break

print(string)

Submission status: Accepted

Solution code:
n = int(input())
string = "No"
for i in range(1, n+1):
        for j in range(1, n+1):
            if n % (4 * i + 7 * j) == 0:
                string = "Yes"
                break
            elif n % (4 * i) == 0:
                string = "Yes"
                break
            elif n % (7 * j) == 0:
                string = "Yes"
                break

print(string)

Submission status: Accepted

Solution code:
n = int(input())
a4 = [4*i for i in range(n//4+1)]
a7 = [7*i for i in range(n//7+1)]

ans = 'No'
for x in a4:
    for y in a7:
        if x+y == n:
            ans = 'Yes'
            break
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
print('Yes' if any(4*i+7*j==n for i in range(26) for j in range(15)) else '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:
n=int(input())
for i in range(15):
  for j in range(26):
    if i*7+j*4==n:
      print('Yes')
      exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

while 11 <= N:
    if N % 4 == 0 or N % 7 == 0 or N % 11 == 0:
        print("Yes")
        exit()

    else:
        N -= 11

if N % 4 == 0 or N % 7 == 0:
    print("Yes")

else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())

ymx = n // 7

for y in range(0, ymx + 1):
    if (n - 7 * y) % 4 == 0:
        print("Yes")
        break
    elif y == ymx:
        print("No")

Submission status: Accepted

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

if N%4==0 or N%7==0:
    flag=True

maximum=N//4
minimum=N//7

for i in range(N//4):
    for j in range(N//7):
        if 4*(i+1)+7*(j+1)==N:
            flag=True
        else:
            continue

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