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//4):
    for j in range(100//7+1):
        if 4 * i + 7 * j == n:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

if (n % 7) == 3 or n in (1, 2, 5, 6, 9, 13):
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
n = int(input())
ans = False
for i in range(0, min(15, n // 7 + 1)):
    if (n - 7 * i) % 4 == 0:
        ans = True
print("Yes" if ans else "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(0)

print('No')

Submission status: Accepted

Solution code:
n=int(input())


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


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

Submission status: Accepted

Solution code:
import sys
N = int(input())
if not ( 1 <= N <= 100 ):
    sys.exit()

for I in range(N // 4 + 1):
    for J in range(N // 7 + 1):
        if 4 * I + J * 7 == N:
            print('Yes')
            sys.exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

c = 0
d = 0

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())
res = "No"
for sum in range(1,26):
    for j in range(sum+1):
        a=j
        b=sum-j
        if a*4 + b*7 ==n:
            res="Yes"
            break
print(res)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = int(input())

ans = False

for j in range(25):  #4$
        for k in range(15):  #7$
            if j + k == 0:
                continue
            if n % ((j * 4) + (k * 7)) == 0:
                ans = True
                break
        if ans:
            break

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

Submission status: Accepted

Solution code:
n = int(input())

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

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

Submission status: Accepted

Solution code:
N = int(input())

#4,7何書いても良い

max_CA = int(N / 4) + int(N % 4) 
max_CB = int(N / 7) + int(N % 7)

#print(f'four:{max_CA}')
#print(f'seven:{max_CB}')

flag = False
for i in range(max_CA +1):
    for j in range(max_CB+1):
        sum_C = 4 * i + 7 * j
        if N == sum_C:
            flag = True
            
if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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())
a=[4*x+7*y for x in range(200) for y in range(200)]
ans="Yes" if N in a else "No"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
a=set(4*x+7*y for x in range(200) for y in range(200))
ans="Yes" if N in a else "No"
print(ans)

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
out="Yes" if ans else "No"
print(out)

Submission status: Accepted

Solution code:
N = int(input())
div, mod = divmod(N, 7)
flag = False
for x in range(0, 100, 4):
    for y in range(0, 100, 7):
        if x + y == N:
            flag = True
            break
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()
else:
  print("No")

Submission status: Accepted

Solution code:
n = int(input())

ans = 'No'
for i4 in range(26):
  for i7 in range(15):
    if i4*4 + i7 *7 - n == 0:
      ans = 'Yes'
      break
    else:
      continue

print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
n=int(input())

n_a=n//4
n_b=n//7

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

Submission status: Accepted

Solution code:
N = int(input())
flag = sum([i+j==N for i in range(0,N+1,4) for j in range(0,N+1,7)])
print("Yes" if flag>0 else "No")

Submission status: Accepted

Solution code:
n=int(input())
ans="No"
for i in range(n//7+1):
  if (n-i*7)%4==0:
    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(0)

print("No")

Submission status: Accepted

Solution code:
N = int(input())
l = []
for i in range(25):
    for j in range(25):
        l.append(i * 4 + j * 7)
ans = 'No'
if N in l:
    ans = 'Yes'
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
buy = [False]*1000
buy[0] = True
for i in range(100):
  if buy[i]:
    buy[i+4] = True
    buy[i+7] = True
    
n = int(input())
if buy[n]:
  print("Yes")
else:
  print("No")

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:
n = int(input())
for c in range(26):
  for d in range(16):
    if 4 * c + 7 * d == n:
      print('Yes')
      exit()
print('No')

Submission status: Accepted

Solution code:
n = int(input())

ans = []
for i in range(n//4+1):
    for j in range(n//7+1):
        if 4*i+7*j <= n:
            ans.append(4*i+7*j)
if ans.count(n) != 0:
    print('Yes')
else:
    print('No')

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

Submission status: Accepted

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

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

for i in range(x + 1):
  one = 7 * (i)
  if (N - one) % 4 == 0:
    print("Yes")
    quit()
print("No")

Submission status: Accepted

Solution code:
n = int(input())
flag = False
for a in range(int(n / 7) + 1):
  for b in range(int(n / 4) + 1):
    if 7 * a + 4 * b == n:
      flag = True

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

Submission status: Accepted

Solution code:
N = int(input())
M = [4*i+7*j for i in range(100) for j in range(100)]

if N in M:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


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

    ans = "No"
    while N >= 0:
        if N % 4 == 0:
            ans = "Yes"
            break
        N -= 7

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt
from copy import deepcopy

def main():
    n = int(input())
    
    if n < 4:
        print("No")
        sys.exit()
        
    if n%4 == 0 or n%7 == 0:
        print("Yes")
        sys.exit()

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

    if n >= 0:
        print("Yes")
    else:
        print("No")



if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())

a = N // 7

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

Submission status: Accepted

Solution code:
def actual(N):
    # 0 <= ケーキの数   <= N/4
    # 0 <= ドーナツの数 <= N/7
    # その範囲で (ケーキの数A, ドーナツの数B) を全探索する
    # N = 4A + 7B を満たす組があれば Yes
    n_max_cakes = N // 4
    n_max_donuts = N // 7

    for n_cakes in range(n_max_cakes + 1):
        for n_donuts in range(n_max_donuts + 1):
            price = (4 * n_cakes) + (7 * n_donuts)

            if price == N:
                return 'Yes'

    return 'No'

N = int(input())
print(actual(N))

Submission status: Accepted

Solution code:
def actual(N):
    oks = []

    for idx, n in enumerate(range(4, 104, 4), start=1):
        for i in range(idx + 1):
            satisfied_value = n + (3 * i)

            if satisfied_value <= 100:
                oks.append(satisfied_value)

    oks = sorted(set(oks))

    if N in oks:
        return 'Yes'

    return 'No'
  
N = int(input())
print(actual(N))

Submission status: Accepted

Solution code:
N = int(input())

"""
4k = N - 7n
"""
for i in range(15):
    k = (N-(7*i)) / 4
    if k % 1 == 0 and k >= 0:
        print("Yes")
        break
    if i == 14:
        print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
a='No'
for i in range(14):
  if N<0:
    break
  if N%4==0:
    a='Yes'
    break
  N-=7
print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
print('Yes' if sum(4 * x + 7 * y == N for x in range(N//4 + 1) for y in range(N//7 + 1)) > 0 else 'No')

Submission status: Accepted

Solution code:
# B - Cakes and Donuts

N = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())

for i in range(101):
    for j in range(101):
        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())
for i in range(n//4+1):
    if n-4*i < 0:
        print("No")
        quit()
    elif (n-4*i)%7 == 0:
        print("Yes")
        quit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

N = int(input())


def ok():
    x = 0
    while x * 4 <= N:
        if (N - x * 4) % 7 == 0:
            return True
        x += 1
    return False

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

ns = set()
for i in range(0, 26):
    for j in range(0, 16):
        ns.add(4*i + 7*j)
if n in ns:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
for c in range(100//4+1):
  for d in range(100//7+1):
    if c*4+d*7==N:
      print("Yes")
      exit()
print("No")

Submission status: Accepted

Solution code:
N = int(input())
List = []
for c in range(100//4 + 1):
  for d in range((100-4*c)//7 + 1):
    if 4*c + 7*d == N:
      List.append(c+d)
    else:
      continue
if bool(List) == True:
  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')
        break
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
if n == 4 or n == 7 or n == 8 or n == 11 or n == 12 or n == 14 or n == 15 or n == 16 or n == 18 or n == 19 or n == 20 or n == 21 or n == 22 or n == 23 or n == 24 or n == 25 or n == 26 or n == 27 or n == 28 or n == 29 or n == 30 or n == 31 or n == 32 or n == 33 or n == 34 or n == 35 or n == 36 or n == 37 or n == 38 or n == 39 or n == 40 or n == 41 or n == 42 or n == 43 or n == 44 or n == 45 or n == 46 or n == 47 or n == 48 or n == 49 or n == 50 or n == 51 or n == 52 or  n == 53 or n == 54 or n == 55 or n == 56 or n == 57 or n == 58 or n == 59 or n == 60 or n == 61 or n == 62 or n == 63 or n == 64 or n == 65 or n == 66 or n == 67 or n == 68 or n == 69 or n == 70 or n == 71 or n == 72 or n == 73 or n == 74 or n == 75 or n == 76 or n == 77 or n == 78 or n == 79 or n == 80 or n == 81 or n == 82 or n == 83 or n == 84 or n == 85 or n == 86 or n == 87 or n == 88 or n == 89 or n == 90 or n == 91 or n == 92 or n == 93 or n == 94 or n == 95 or n == 96 or n == 97 or n == 98 or n == 99 or n == 100:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
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())
flag = False
for t in range(0,25):
    for i in range(0,15):
        if t !=0 or i != 0:
            if t*4 + i*7==n:
                flag = True
if flag :
    print("Yes")
else :
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
flg = False
i = 0
while 7 * i <= N:
    j = 0
    while 7 * i + 4 * j <= N:
        if 7 * i + 4 * j == N:
            flg = True
            break
        j += 1
    if flg:
        break
    i += 1
if flg:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
"""
N = list(map(int,input().split()))
S = [str(input()) for _ in range(N)]
S = [list(map(int,list(input()))) for _ in range(h)] 
print(*S,sep="")
"""

import sys
sys.setrecursionlimit(10**6)
input = lambda: sys.stdin.readline().rstrip()
inf = float("inf") # 無限

def main():
    n = int(input())
    if not (n%4) or not(n%7):
        print("Yes")
        return
    for i in range(4,n,4):
        for j in range(7,n,7):
            # print(i,j)
            if n < i+j:
                continue
            elif n == i+j:
                print("Yes")
                return
    print("No")
    return



if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def main():
    N = int(input())
    for b in range(N // 7, -1, -1):
        a = N - 7 * b
        if a % 4 == 0:
            print("Yes")
            return
    print("No")


if __name__ == "__main__":
    main()

Submission status: Accepted

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

for i in range(0,1+100//4):
  for j in range(0,1+100//7):
    if 4*i + 7*j <= 100:
      arr.append(4*i+7*j)

if N in arr:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n=int(input())

for i in range(n):
  if (n-4*i)>=0 and (n-4*i)%7==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())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


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

    for a in range(N // 4 + 1):
        for b in range(N // 7 + 1):
            if a * 4 + b * 7 == N:
                print("Yes")
                sys.exit()

    print("No")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
for q in range(0, n, 7):
    if q == 0:
        continue
    if (n - q) % 4 == 0:
        print("Yes")
        exit(0)
print("No" if (n % 4 != 0) and (n % 7 != 0) else "Yes")

Submission status: Accepted

Solution code:
n = int(input())

def dfs(x):
  if x > n: return
  if x == n: print("Yes"), exit(0)
  dfs(x + 4)
  dfs(x + 7)

dfs(0)
print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if n % 7 == 0:
    flg = True
else:
    for i in range(int(n/7) + 1):
        m = n - i * 7
        if m % 4 == 0:
            flg = True
            break

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect
import copy
import heapq
import math
import sys
from collections import *
from itertools import accumulate, combinations, permutations, product
# from math import gcd
from functools import lru_cache
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
sys.setrecursionlimit(5000000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

n=int(input())

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

Submission status: Accepted

Solution code:
N=int(input())
C_max=N//4
D_max=N//7
M=0

for i in range(C_max+1):
    for j in range(D_max+1):
        if N== 4*i+7*j:
            M+=1
if M==0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

for i in range(N//7+1):
    for j in range(N//4+1):
        money = 7*i + 4*j
        if money == N:
            flg = 1
            break
      
if flg == 1:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N = int(input())

found = False
for x in range(0, 25+1):
    for y in range(0, 14+1):
        if 4 * x + 7 * y == N:
            found = True
if found:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

print('No')

Submission status: Accepted

Solution code:
def main():
    total = int(input())
    i = 0
    j = 0

    for i in range(26):
        for j in range(16):
            if total == (i*4 + j*7):
                print('Yes')
                return

    print('No')

main()

Submission status: Accepted

Solution code:
n = int(input())
a = n//4
b = n//7
ans = False

for i in range(a+1):
  for j in range(b+1):
    if i*4+j*7 == n:
      ans = True

if ans == True:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N = int(input())
flag =0 #yesフラグ
ext1 = N // 4
ext2 = N // 7

if ext1 == 0:
  print("No")
else:
  for i in range(ext1 +1):
    for j in range (ext2 +1):
      if i*4 + j*7 ==N:
        flag +=1
  print("Yes"if flag >0 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())
ans = "No"
for cake_n in range(30):
    for donut_n in range(15):
        if n == cake_n * 4 + donut_n * 7:
            ans = "Yes"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    m = 100 // 7 + 1
    flag = False
    for i in range(m):
        for j in range(m):
            if n == i * 7 + j * 4:
                flag = True
                if flag:
                    print('Yes')
                    break
        else:
            continue
        break
    if not flag:
        print('No')
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())

s = 0
y = 0

for c in range(26):
    for d in range(15):
        s = c*4 + d*7
        if s == N:
            y += 1
            print('Yes')
            break
        else:
            pass
    if y > 0:
        break
    else:
        pass

if y == 0:
    print('No')
else:
    pass

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
for i in range(int(100/4)+1):
    for j in range(int(100/7)+1):
        if n == 4*i+7*j:
            print('Yes')
            sys.exit(0)

print('No')

Submission status: Accepted

Solution code:
# input
N = int(input())

# check
if N < 4:
    print("No")
else:
    for seven_n in range(0, N + 1, 7):
        if (N - seven_n) % 4 == 0 or N - seven_n == 0:
            print("Yes")
            exit(0)
    print("No")

Submission status: Accepted

Solution code:
n=int(input())
ok=False
if n%4==0:
    print("Yes")
else:
    while n>0:
        if n%7==0:
            ok=True
            break
        n-=4
    if ok:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
ans = "No"
while (N >= 0):
  if N % 4 == 0 or N % 7 == 0:
    ans = "Yes"
  N -= 11
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())
a = -1
count = 0
while n-4*a > 0:
    a += 1
    if (n-4*a) % 7 == 0:
        count += 1
        break
    else:
        continue
if count == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
xmax, ymax = n//4, n//7
ok = False
for x in range(0, xmax+1):
    for y in range(0, ymax+1):
        if n == 4*x + 7*y:
            ok = True
            break
    if ok: break
print("Yes" if ok else "No")

Submission status: Accepted

Solution code:
n = int(input())
a = n//4 # max x
b = n//7 # max y
ok = False
for x in range(0,a+1):
    for y in range(0,b+1):
        if n == 4*x + 7*y:
            ok = True
            break
    if ok: break

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

Submission status: Accepted

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

Submission status: Accepted

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

flag = False

for i in range(math.ceil(N/7)+1):
    for j in range(math.ceil(N/4)+1):
        if flag == True:
            continue
        #print(N - i * 7 - j * 4 )
        if N - i * 7 - j * 4 == 0:
            flag = True

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

Submission status: Accepted

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

flag = False

for i in range(100):
    for j in range(100):
        if flag == True:
            continue
        #print(N - i * 7 - j * 4 )
        if N - i * 7 - j * 4 == 0:
            flag = True

if flag == True:
    print('Yes')
else:
    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 i*4+j*7==n:
      ans=1
print(["No","Yes"][ans])

Submission status: Accepted

Solution code:
N=int(input())
c=4
d=7
ans=0
ans2=0
ans3="No"
for i in range(15):
    ans=d*i
    if ans !=N:
        for j in range(26):
            ans2=ans+c*j
            if ans2==N:
                ans3="Yes"

    else :
        ans3="Yes"

print(ans3)

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 = "No"
for i in range(N // 7 + 1):
    for j in range((N - i*7) // 4 + 1):
        if 7*i + 4*j == N:
            ans = "Yes"
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
# sys.setrecursionlimit(10**7)

n = int(input())

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