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())
i = 0
while i < N // 4:
    if (N - 4 * i) % 4 == 0:
        print('Yes')
        break
    elif (N - 4 * i) % 7 == 0:
        print('Yes')
        break
    else:
        i += 1
if i == N // 4:
    print('No')

Submission status: Accepted

Solution code:
# 2019/04/04
# AtCoder Beginner Contest 105 - B

n = int(input())

ans = "No"
for i in range(0, 100, 4):
    for j in range(0, 100, 7):
        if i + j == n:
            ans = "Yes"
            break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
if N % 2:
    N -= 7
if N % 4:
    N -= 14
if N >= 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
print('Yes' if N in [4 * c + 7 * d for c in range(N // 4 + 1) for d in range(N // 7 + 1)] else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
N = int(input())
for i in range(100):
    for j in range(100):
        if( N == (4*i+7*j) ):
            print('Yes')
            sys.exit()
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(0)
print("No")

Submission status: Accepted

Solution code:
import sys

n = int(input())

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

Submission status: Accepted

Solution code:
from sys import stdin
N=int(stdin.readline().rstrip())
flag=0
for i in range(30):
    for j in range(20):
        if i*4 + j*7 == N:
            flag=1
if flag == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

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

Submission status: Accepted

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

n = int(input())

ans = False

for i in range(25):
    for j in range(25):
        money = 4 * j + 7 * i
        if n == money:
            ans = True
            break

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

Submission status: Accepted

Solution code:
N = int(input())
def four(n):
    if n % 4 is 0:
        return 0
    else:
        return n

def seven(n):
    if n % 7 is 0:
        return 0
    else:
        return n

def judge(n):
    if four(n) is 0:
        return 0
    elif seven(n) is 0:
        return 0
    elif n < 4:
        return 1
    else:
        n -= 4
        return judge(n)

if judge(N) is 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
#coding: utf-8
N = int(input())
flag = False
for i in range(100//4+1):
    for j in range(100//7+1):
        if 4 * i + 7 * j == N:
            flag = True
            break
print("Yes" if flag else "No")

Submission status: Accepted

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

for i in range(26):
    for j in range(15):
        white_list.append(4*i+7*j)


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

Submission status: Accepted

Solution code:
N = int(input())

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
f,s=0,0
while f*4+s*7<=n:
  if f*4+s*7==n:
    print("Yes")
    exit()
  while f*4+s*7<=n:
    if f*4+s*7==n:
      print("Yes")
      exit()
    s+=1
  s=0
  f+=1
print("No")

Submission status: Accepted

Solution code:
N = int(input())
c = N//4
d = N//7
for i in range(c+1):
    for  j in range(d+1):
        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(25):
    for j in range(15):
        if 4*i + 7*j == N:
            ans = "Yes"
            break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

ans = False
for i in range(100//7 + 2):
  for j in range(100//4 + 2):
    if i*7 + j*4 == n:
      ans = True
      break

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

Submission status: Accepted

Solution code:
#105
n = int(input())
list = [1,2,3,5,6,9,10,13,17]
if list.count(n)==1:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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())
a,b=25,14
a=False

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
from sys import stdin
n = int(stdin.readline().rstrip())
for i in range(100):
    for j in range(100):
        if i*4 + j*7 == n:
            print('Yes')
            sys.exit()
print('No')

Submission status: Accepted

Solution code:
n = int(input())
b = []
for i in range(100//4 + 1):
    a = 4*i
    while (a <= 100):
        b.append(a)
        a += 7
b = list(set(sorted(b)))
if n in b:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(int(100/7)+1):
    if 7*i > N:
        break
    for j in range(26):
        if 7*i+4*j > N:
            break
        elif 7*i+4*j == N:
            judge = True
            break
    
if judge:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def inp_i(): return map(int, input().split())

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

Submission status: Accepted

Solution code:
N=int(input())
flag=True
for i in range(26):
    if flag:
        for j in range(16):
            if 4*i+7*j==N:
                print('Yes')
                flag=False
                break
if flag:
    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())

dp = [False for i in range(N + 1)]
prices = [4, 7]
dp[0] = True

for p in prices:
    for j in range(N + 1):
        if not dp[j]:
            continue
        idx = j + p
        if idx > N:
            break
        dp[idx] = True
if dp[N]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# 処理
exist = False           # 条件を満たす買い方が存在する
for i in range(100):    # ケーキを買う個数
  for j in range(100):  # ドーナツを買う個数
    s = i*4 + j*7       # 合計金額
    if s == N:          
      exist = True      # 条件を満たす買い方を見つけた

# 出力
if exist:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys  # sys.exit()のために必要

# 入力
N = int(input())

# 処理
for i in range(100):    # ケーキを買う個数
  for j in range(100):  # ドーナツを買う個数
    s = i*4 + j*7       # 合計金額
    if s == N:          # 条件を満たす買い方を見つけた
      print("Yes")
      sys.exit(0)       # プログラムを終了
print("No")

Submission status: Accepted

Solution code:
N=int(input())
true=False
can=False
for num7 in range(100):
    if can:
        break
    for num4 in range(100):
        sum=num7*7+num4*4
        if sum>N:
            break
        if sum==N:
            true=True
            can=True
            break
if true:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

for i in range(26):
    for j in range(16):
        sum_num = 4*i + 7*j
        if 100 < sum_num:
            break

        if sum_num == n:
            print("Yes")
            exit()
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())
judge = 0

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

Submission status: Accepted

Solution code:
N = int(input())
n = N % 28
incorrects = [1,2,3,5,6,9,10,13,17]
answer = True
for incorrect in incorrects:
    if n == incorrect:
        answer = False
        break
if answer:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
ans = "No"
for i in range(15):
    now = N - i * 7
    if now >= 0 and now % 4 == 0:
        ans = "Yes"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC105 B
#
#Nから7を順番に引いていき,4の倍数になったときに4以上になっているかどうかを判定すればよい
N = int(input())
if N%7 == 0:
	print('Yes')

else:
	while N%4 != 0:
		N = N - 7
	if N >= 4:
		print('Yes')
	else:
		print('No')

Submission status: Accepted

Solution code:
n = int(input())

flag = False
for ai in range(100):
	for bi in range(100):
		if ai*4+bi*7 == n:
			flag = True
			break

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

Submission status: Accepted

Solution code:
n = int(input())

aNum = 100//4
bNum = 100//7

flag = False
for ai in range(aNum):
	for bi in range(bNum):
		if ai*4+bi*7 == n:
			flag = True

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

Submission status: Accepted

Solution code:
n=int(input())
a=[]
for x in range(15):
    for y in range(26):
        a.append(x*7+y*4)
if not n in a:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
import sys

N = int(input())
flag = False
for i in range((101 // 4) + 1):
    for j in range((101 // 7) + 1):
        total = (4 * i + 7 * j)
        if total == 0:
            continue
        if N == total:
            print("Yes")
            flag = True
            break
    if flag:
        break
if not flag:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

ans = False

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

c = 0

for i in range(25):
	for j in range(15):
		if i*4+j*7 == n:
			c += 1
	
		if i*4+j*7 >100:
			break
  
if c != 0:
	print('Yes')
else:
	print('No')

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

able = False
for i in range(int(N / 4) + 1):
    for j in range(int(N / 7) + 1):
        if 4 * i + 7 * j == N:
            able = True
print('Yes' if able else 'No')

Submission status: Accepted

Solution code:
def cakes_and_donuts(N: int) -> bool:
    while N > 0:
        if N % 4 == 0:
            return True
        N -= 7

    return N == 0  # <=> N % 7 == 0


if __name__ == "__main__":
    N = int(input())
    yes = cakes_and_donuts(N)
    print('Yes' if yes 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())
flag = False
for i in range(N // 4 + 1):
    for j in range(N // 7 + 1):
        if 4 * i + 7 * j == N:
            flag = True
            break
    if flag:
        break
if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
def rec(x):
  if x < 4:
    return False
  if x % 4 == 0 or x % 7 == 0:
    return True
  return rec(x - 4) or rec(x - 7)
 
if rec(int(input())):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import sys

N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
count = 0
for i in range(0,25):
    cake = i*4
    for j in range(0,14):
        donut = j*7
        if cake + donut == N:
            count += 1
            break
if count == 0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
n = int(input())
r=[4, 7, 8, 11, 12, 14, 15, 16]
if n>17 or n in r:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def solve(string):
    n = int(string)
    return "Yes" if any([(n - 7 * i) % 4 == 0 for i in range(n // 7 + 1)]) else "No"


if __name__ == '__main__':
    print(solve(input()))

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:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

N = int(input())

n7 = N//7+1

ans = "No"
for i in reversed(range(n7+1)):
    if 7*i > N:
        continue
    elif 7*i == N:
        ans = "Yes"
        break
    else:
        r = N-7*i
        if r % 4 == 0:
            ans = "Yes"
            break
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

totals = [4 * x + 7 * y for x in range(N // 4 + 1) for y in range(N // 7 + 1)]
print('Yes' if N in totals else 'No')

Submission status: Accepted

Solution code:
N = int(input())
answer = 'No'

if N % 7 ==0:
    answer = 'Yes'

while N > 0:
    if N % 4 == 0:
        answer = 'Yes'
    N -= 7

else:
    print(answer)

Submission status: Accepted

Solution code:
def solve():
    N = int(input())
    for i in range(16):
        if N - 7 * i < 0:
            continue
        if (N - 7 * i) % 4 == 0:
            return 'Yes'
    return 'No'

ans = solve()
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

def func(n):
    for k in range(N//4 + 1):
        for d in range(N//7 + 1):
            if 4 * k + 7 * d == N:
                return 'Yes'
    return 'No'

print(func(N))

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc105/tasks/abc105_b
n = int(input())
for c in range(n // 4 + 1):
    if (n - c * 4) % 7 == 0:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

Solution code:
N = int(input())

ans='No'
if N%7==0:
  ans = 'Yes'
elif N%4==0:
  ans = 'Yes'
else:
  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())
flag=False

for x in range(100//4+1):
  for y in range(100//7+1):
    if 4*x+7*y==N:
      flag=True
      break

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

Submission status: Accepted

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

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 4*i + 7*j == N:   
      flag = 1
if flag == 0:
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
n=int(input())
l=[]
for i in range(26):
    for k in range(16):
        l.append(4*i+7*k)
print("YNeos"[n not in l::2])

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    dp = [False] * (N+10)
    dp[0] = True
    for i in range(N+1):
        if dp[i]:
            dp[i+4] = True
            dp[i+7] = True
    if dp[N]:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
flag = False
for i in range(100):
    if (N - i * 4) % 7 == 0:
        flag = True
    if (N - i * 4) < 0:
        break
if flag == True:
    print('Yes') 
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math
import sys


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

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 27 16:39:16 2019

@author: yuta
"""

def cakedonut(n):
    count = 0
    if n != 0:
        max_count = (int(n/7) + 1) * (int(n/4) + 1)
        for i in range(int(n/7) + 1):
            for j in range(int(n/4) + 1):
                price = 7 * i + 4 * j
                rest = n - price
                if rest == 0:
                    break
                else:
                    count += 1
        if count < max_count:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
        
N = int(input())
cakedonut(N)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
D = None

for i in range(int(N/4)+1):
    for j in range(int(N/7)+1):
        if 4*i+7*j == N:
            D = True
            break
        elif j == int(N/7)+1:
            D = False

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

Submission status: Accepted

Solution code:
N = int(input())
max_c = N//4 
max_d = N//7
flag = 0
for i in range(max_c + 1):
	for j in range(max_d + 1):
		cost = 4*i + 7*j
		if cost == N:
			flag = 1

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

Submission status: Accepted

Solution code:
def det(n):
    seven = range((n // 7) + 1)
    four = range((n // 4) + 1)
    for i in seven:
        for p in four:
            if (i*7 + p*4) == n:
                return 'Yes'
    return 'No'
x = int(input())
print(det(x))

Submission status: Accepted

Solution code:
n=int(input())
for s in range(0,26):
  try:
    for t in range(0,16):
      if 4*s+7*t==n:
        print("Yes")
        exit()
  except ZeroDivisionError:
    continue
print("No")

Submission status: Accepted

Solution code:
def main():
    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")
                return
    print("No")


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def cakes_and_donuts(arg1):
    four = range(( arg1 // 4 ) + 1)
    seven = range(( arg1 // 7 ) + 1)
    for i in seven:
        for p in four:
            if (i*7 + p*4) == arg1:
                return 'Yes'
    return 'No'

N = int(input())
print(cakes_and_donuts(N))

Submission status: Accepted

Solution code:
n=int(input());print('YNeos'[n<-n%4*7::2])

Submission status: Accepted

Solution code:
N = int(input())
answer = "No"
cake = N//4
nut = N//7

for x in range(cake+1):
  for y in range(nut+1):
    if 4*x + 7*y == N:
      answer = "Yes"

print(answer)

Submission status: Accepted

Solution code:
N = int(input())

cake = N//4
nut = N//7

answer = 'No'

for i in range(cake+1):
	for j in range(nut+1):
		if i*4 + j*7 == N:
			answer = 'Yes'

print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

  for i in range(26):
    if i * 4 > N:
      break
    if (N - i * 4) % 7 == 0:
      print('Yes')
      return
  print('No')

if __name__ == '__main__':
  main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc105/tasks/abc105_b

def main():
    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")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#105B.py
N=int(input())
count=0
for i in range(N):
	for j in range(N):
		if(N==4*i+7*j):
			count+=1
if count==0:
	print("No")
else:
	print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
flag = 'No'
for f in range(25):
  for s in range(15):
    if n == f * 4 + s * 7 or n % 4 == 0 or n % 7 == 0:
      flag = 'Yes'
      break
print(flag)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())

if N%4==0:
  print('Yes')
elif N%4==1:
  if N>=21:
    print('Yes')
  else:
    print('No')
elif N%4==2:
  if N>=14:
    print('Yes')
  else:
    print('No')
elif N%4==3:
  if N>=7:
    print('Yes')
  else:
    print('No')

Submission status: Accepted

Solution code:
def main() -> None:
    N = int(input())
    for x in range(0, N+1, 4):
        for y in range(0, N+1, 7):
            if x + y == N:
                print("Yes")
                exit()
    print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())

torf = False

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

if n >= 18:
    print("Yes")
elif 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:
int_n = int(input())

if int_n in [4 * k + 7 * d for k in range(101) for d in range(101)]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n=int(input())

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

Submission status: Accepted

Solution code:
import sys

def main():
  input = sys.stdin.readline
  N = int(input())
  
  ans = 'No'
  if N % 7 == 0:
    ans = 'Yes'
  else:
    for i in range(N//7+ 1):
      m = N - 7 * i
      if m % 4 == 0:
        ans = 'Yes'
        break
  
  print(ans)


if __name__ == '__main__':
  main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

flg = False

for i in range(101):
    for j in range(101):
        if 100 < i + j:
            break
        if 4 * i + 7 * j == N:
            flg = True
            continue
    if flg:
        break

print("Yes" if flg 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')
            import sys
            sys.exit()
print('No')