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:
def examB():
    N = I()
    cur = "No"
    cake = N//4
    for i in range(cake+1):
        if (N-i*4)%7==0:
            cur = "Yes"
            break
    print(cur)

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examB()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

for y in range(15):
    x = N - 7 * y
    if x < 0:
        break
    if x % 4 == 0:
        print("Yes")
        exit()

print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# 各個数のケーキについて
for nc in range(N//4+1):
    res=N-(nc*4) # ドーナツで払う金額

    if res%7==0: # 割り切れるなら
        OKflag=True
        break

if OKflag==True: # ある場合
    print("Yes")
else: # ない場合
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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==0 and j==0:
            continue
        if n%((4*i)+(7*j)) == 0:
            flag = True
            break
if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys


def main():
    N = int(input())
    M = N // 7

    for m in range(M+1):
        d = N - m * 7
        if d % 4 == 0:
            print('Yes')
            sys.exit()
    else:
        print('No')


main()

Submission status: Accepted

Solution code:
A = int(input())
Flag = False
for i in range((A//4)+1):
  for j in range((A//7)+1):
    if A == 3:
      break;
    elif 4*i + 7*j == A:
      Flag = True
if Flag:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
A = int(input())
Flag = False
for i in range((A//4)+1):
  for j in range((A//7)+1):
    if 4*i + 7*j == A:
      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(16):
        if 4*i+7*j == N:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

Solution code:

N = int(input())
#１個４ドルのケーキと１個７ドルのドーナツが合計Nドルになる買い方があるか？

a = N // 4
b = N // 7

flag = 0

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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


def solve(N: int):
    ans = NO
    for i in range(int(100//4)):
        for j in range(int(100//7)):
            if 4*i + 7*j == N:
                ans = YES
                break
    print(ans)
# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    N = int(input())  # type: int
    solve(N)

if __name__ == '__main__':
    main()

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

Submission status: Accepted

Solution code:
N=int(input())

isYes=False
num=0
while (7*num<=N):
    if ((N-7*num)%4==0):
        isYes=True
        break
    num+=1

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

Submission status: Accepted

Solution code:
n = int(input())
s = set()
for n4 in range(26):
  for n7 in range(15):
    s.add(4 * n4 + 7 * n7)
if n in s:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy,copy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def main():
    n = INT()
    while n >= 0:
    	if n%4==0 or n%7==0:
    		print('Yes')
    		sys.exit()
    	n -= 11
    print('No')


if  __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N = INT()

can = [0]*101
can[0] = 0

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

Submission status: Accepted

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

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'
        break
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
cake = 4
donut = 7

for i in range((100//cake) + 1):
  is_break = False
  for j in range((100//donut) + 1):
    num = cake * i + donut * j
    if N == num:
      print('Yes')
      is_break = True
      break
  if is_break:
    break
else:
  print('No')

Submission status: Accepted

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

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

print("No")

Submission status: Accepted

Solution code:
a = int(input())

#リストの定義
l = []

for i in range(100//4+1):
	for j in range(100//7+1):
		l.append(4*i+7*j)

#リスト中の重複を削除
set(l)

#l.sort()
#print(l)

#リストlの中にaがある時
if a in l :
	print('Yes')
else:
	print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())

max_donuts = N // 7
count = 0
for num_donuts in range(max_donuts+1):
    if (N -num_donuts*7) % 4 == 0:
        count += 1
        break
if count == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

can_buy = 'No'

for i in range(n // 4 + 1):
    
    for j in range(n // 7 + 1):

        if 4 * i + 7 * j == n:
            can_buy = 'Yes'
            break
    
    if can_buy == 'Yes':
        break

print(can_buy)

Submission status: Accepted

Solution code:
from sys import stdin

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

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

Submission status: Accepted

Solution code:
n = int(input())
b = [4, 7]
p = [0]

while 1:
	pt = []
	for i in range(len(p)):
		for j in range(2):
			if p[i]+b[j] < n:
				pt.append(p[i]+b[j])
			elif p[i]+b[j] == n:
				print("Yes")
				exit(0)
	if len(pt) == 0:
		print("No")
		exit(0)
	else:
		p = pt

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def main():
  N = int(input())
  l = N // 4

  for i in range(l + 1):
    j = (N - i * 4) // 7
    if i * 4 + j * 7 == N:
      print('Yes')
      sys.exit()

  print('No')

main()

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())
a=n//7+1
flag=1
for i in range(a):
  if (n-7*i)%4==0:
    flag*=0
if flag==1:
  print('No')
else:
  print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

flg = False
for c in range(26):
    for d in range(15):
        if c*4 + d*7 == n:
            flg = True

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

Submission status: Accepted

Solution code:
n = int(input())
ans = False
for i in range(21):
  for j in range(15):
    if i * 4 + j * 7 == n:
      ans = True
      break

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

Submission status: Accepted

Solution code:
n = int(input())
fin = False
for i in range(0, 26):
    for j in range(0, 15):
        if i*4 + j*7 == n:
            fin = True
if fin:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())

f = 0

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

Submission status: Accepted

Solution code:
N = int(input())

C = N//4
D = N//7
count = 0
for c in range(0,C+1):
    for d in range(0,D+1):
        if (4*c) + (7*d) == N:
            count += 1

if count > 0:
    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:
from sys import exit
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(0, 1 + N//4):
    for j in range(0, 1 + N//7):
        if (N < 4*i + 7*j): break
        if (4*i + 7*j == N): 
            print('Yes')
            exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#                         author:  kagemeka 
#                         created: 2019-11-09 11:51:37(JST)
### modules
## from standard library
import sys
# import collections
# import math
# import string
# import bisect
# import re
# import itertools
# import statistics
# import functools
# import operator
## from external libraries
# import scipy.special   
# import scipy.misc      
# import numpy as np 

def main():
    n = int(sys.stdin.readline().rstrip())
    
    for x in range(n // 7 + 1):
        if (n - 7 * x) % 4 == 0:
            print('Yes')
            exit()
    print('No')


if __name__ == "__main__":
    # execute only if run as a script
    main()

Submission status: Accepted

Solution code:
x=int(input());print("No" if x<4 or 4<x<7 or 8<x<11 or x==13 or x==17 else "Yes")

Submission status: Accepted

Solution code:
x=int(input())
print("No" if x<4 or 4<x<7 or 8<x<11 or x==13 or x==17 else "Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
bm = int(N/7)

flag = 0
for b in range(bm + 1):
  if((N-7*b)%4 == 0):
    flag = 1
    break

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

Submission status: Accepted

Solution code:
n = int(input())
DP = [False]*(n+1)
DP[0] = True
for i in range(n):
    if not DP[i]:
        continue
    for j in [4,7]:
        if i+j<=n:
            DP[i+j] = True
print(["No", "Yes"][DP[-1]])

Submission status: Accepted

Solution code:
n = int(input())
se = set()

for i in range(100):
    for j in range(100):
        se.add(i*7+j*4)

print('Yes' if n in se else 'No')

Submission status: Accepted

Solution code:
n = int(input())

cake = n // 4

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

Submission status: Accepted

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

for i in range(25):
    for m in range(14):
        if n == 4*i + 7*m:
            print("Yes")
            sys.exit()
        else:
            continue
print("No")

Submission status: Accepted

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

for p in range(25):
    for q in range(15):
            if (N - 4*p - 7*q) == 0:
                ans = "Yes"
                break
                
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

ans = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

ans = False
for i in range(0, n + 1, 4):
    for j in range(0, n + 1, 7):
        if i + j == n:
            ans = True

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
def func_1(x):
    co = 0
    for i in range(26):
        for j in range(13):
            if 4*i + 7*j == x:
                co += 1
    if co != 0:
        print("Yes")
    else:
        print("No")
func_1(N)

Submission status: Accepted

Solution code:
N = int(input())
co = 0
for i in range(26):
    for j in range(13):
        if 4*i + 7*j == N:
            co += 1

if co != 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")


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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

print("No")

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())
flag = 0
for i in range(0, 101, 7):
    if flag==1:
        break
    for j in range(0, 101, 4):
        if N == i + j:
            flag = 1
            break

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

Submission status: Accepted

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

N = int(input())
dp = [0] * (N + 1)
dp[0] = 1
for i in range(N + 1):
  if i + 4 <= N:
    dp[i + 4] += dp[i]
  if i + 7 <= N:
    dp[i + 7] += dp[i]
if dp[-1]:
  print("Yes")
else: print("No")

Submission status: Accepted

Solution code:
n = int(input())
a = []
for i in range(25):
	a.append((i+1)*4)
b = []
for i in range(14):
	b.append((i+1)*7)
c = []
for i in range(25):
	for j in range(14):
		if(a[i]+b[j] <= 100):
			c.append(a[i]+b[j])
d = []
d.extend(a)
d.extend(b)
d.extend(c)
e = []
e = list(set(d))
e.sort()
if n in e:
	print ("Yes")
else:
	print ("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
j = len([1 for c in range(n//4+1) for d in range(n//7+1) if n-4*c-7*d==0])
print("Yes" if j > 0 else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

A = int(N / 4)
B = int(N / 7)

jug = False

for i in range(0, (A + 1)* 4, 4):
    if jug == True:
        break
    for j in range(0, (B + 1) * 7, 7):
        if i + j == N:
            print("Yes")
            jug = True
            break

if jug == False:
    print("No")

Submission status: Accepted

Solution code:
#
# abc105 b
#
import unittest
from io import StringIO
import sys


def input():
    return sys.stdin.readline().rstrip()


def resolve():
    N = int(input())
    C = 4
    D = 7

    for i in range(N//C+1):
        for j in range(N//D+1):
            if i*C + j*D == N:
                print("Yes")
                exit()
    print("No")


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """11"""
        output = """Yes"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """40"""
        output = """Yes"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """3"""
        output = """No"""
        self.assertIO(input, output)


if __name__ == "__main__":
    #unittest.main()
    resolve()

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
#2019/10/25
# N = int(open(0).read())
N = int(input())
maxCake = N//4+1
maxDon = N//7+1
flg =False
for i in range(maxCake):
    for j in range(maxDon):
        if i*4+j*7==N:
            print('Yes')
            flg = True
            break;
    if flg == True:
        break
if flg == False:
    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')
      quit()
print('No')

Submission status: Accepted

Solution code:
# ABC105B - Cakes and Donuts
def main():
    N = int(input())
    if N % 4 == 0 or N % 7 == 0:
        print("Yes")
    elif N < 4:
        print("No")
    else:
        while N > 7:
            N -= 4
            if N % 4 == 0 or N % 7 == 0:
                print("Yes")
                return
        print("No")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:

N = int(input())

cake_price = 4
donut_price = 7

max_cake = N // cake_price
max_donut = N // donut_price

isJustN = False
if max_cake * cake_price == N or max_donut * donut_price == N:
    isJustN = True
else:
    for c in range(1, max_cake + 1):
        for d in range(1, max_donut + 1):
            total_price = cake_price * c + donut_price * d
            if total_price == N:
                isJustN = True
                break

Result = ''
Result = 'Yes' if isJustN == True else 'No'
print(Result)

Submission status: Accepted

Solution code:

N = int(input())

cake_price = 4
donut_price = 7

max_cake = N // cake_price
max_donut = N // donut_price

isJustN = False
if max_cake * cake_price == N or max_donut * donut_price == N:
    isJustN = True
else:
    for c in range(1, max_cake + 1):
        for d in range(1, max_donut + 1):
            total_price = cake_price * c + donut_price * d
            if total_price == N:
                isJustN = True
                break

Result = ''
if isJustN == True:
    Result = 'Yes'
else:
    Result = 'No'
print(Result)

Submission status: Accepted

Solution code:
n=int(input())
if n%4==0:
    print('Yes')
elif n%4==1 and n>=21:
    print('Yes')
elif n%4==2 and n>=14:
    print('Yes')
elif n%4==3 and n>=7:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l4=[4*i for i in range(100//4+1)]
l7=[7*i for i in range(100//7+1)]
l=[]
for x in l4:
    l.extend(map(lambda y:y+x,l7))

print('Yes' if int(input()) in l else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = int(input())

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

Submission status: Accepted

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

for i in range(n):
  for j in range(n):
    if 4*i+7*j==n:
      judge+=1
if judge!=0:
  print('Yes')
if judge==0:
  print('No')

Submission status: Accepted

Solution code:
N = int(input())


for i in range(0,N // 4 + 1): # 4で除した値まで回す
    for j in range(0,N // 7 + 1):# 7で除した値まで回す
        if (4* i + 7 * j) == N:
            print("Yes")
            #print("i is", i)
            #print("j is", j)
            exit()

print("No")

Submission status: Accepted

Solution code:
N=int(input())
flg=False
for i in range(25):
    cnt=4*i
    if cnt>N: break
    if cnt==N:
        flg=True
        break
    for j in range(13):
        cnt+=7
        if cnt>N: break
        if cnt==N:
            flg=True
            break
print("Yes" if flg else "No")

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

flag = False
for i in range(26):
    for j in range(15):
        if 4*i + 7*j == n:
            flag = True
            break
        elif 4*i + 7*j > n:
            break
    if flag:
        break

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

l = set()
for i in range(0, 101) :
    for j in range(0, 101) :
        l.add(4*i + 7*j)
        
if N in l :
    print('Yes')
else :
    print('No')

Submission status: Accepted

Solution code:
N = int(input())

for n_cake in range(N//4 + 1):
    for n_donut in range(N//7 + 1):
        if 4*n_cake + 7*n_donut == N:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

Solution code:
N = int(input())

ans = "No"
for i in range(N // 4 + 1):
    for j in range(N // 7 + 1):
        total = (4 * i) + (7 * j)
        if total == N:
            ans = "Yes"
            break
    else:
        continue
    break

print(ans)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

print(flg)