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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

for i in range(a+1):
  for j in range(b+1):
    if 7*i+4*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())

ans= "No"

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

Submission status: Accepted

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

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

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())
b=0
for i in range(0,26):
    for j in range(0,16):
        if 4*i+7*j==N:
            b+=1
if b!=0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

for i in range(26):
  for j in range(16):
    total = 4*i + 7*j
    
    if total==N:
      answer="Yes"

print(answer)

Submission status: Accepted

Solution code:
n = int(input())
ans = "No"
for f in range(26):
    for s in range(15):
        if f * 4 + s * 7 == n:
            ans = "Yes"
            break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
n = int(input())
for i in range(26):
    for j in range(15):
        if 4*i+7*j ==n:
            print("Yes")
            sys.exit()
else:
    print("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 
if ans:
    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 and (n-4*i)//7>=0:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

p_list = []
for a in range(26):
    for b in range(16):
        p = 4 * a + 7 * b
        p_list.append(p)
a = p_list.count(N)
if a > 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())

for i in range(7):
    b = a - i*4
    if b >= 0 and b % 7 ==0:
        print("Yes")
        exit()

print("No")

Submission status: Accepted

Solution code:
if __name__ == '__main__':

    n = int(input())
    
    flg = False

    for i in range(0,101,4):
        for j in range(0,101,7):
            if i + j > 100:
                break
            if n - (i+j) == 0:
                flg = True
                break
        if flg:
            break

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

Submission status: Accepted

Solution code:
N=int(input())
L=[0]
for i in range(30):
  L+=[i+4 for i in L]+[i+7 for i in L]
  L=list(set(L))
if N in L:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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


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)


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


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

Submission status: Accepted

Solution code:
n = int(input())

f = False

for i in range(26):
    for j in range(15):
        if 4 * i + 7 * j == n:
            f = True
            break
        else:
            pass

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

Submission status: Accepted

Solution code:
n = int(input())

count = 0

for i in range(26):
    for j in range(15):
        if 4 * i + 7 * j == n:
            count += 1
            break
        else:
            pass

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

N = int(input())
ck = math.floor(N/4)
dk = math.floor(N/7)

c = 4
d = 7
result = False

for i in range(ck+1):
    for j in range(dk+1):
        if (N == c * i + d * j):
            result = True
            break

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

Submission status: Accepted

Solution code:
N = int(input())

c = 4
d = 7
result = False

for i in range(26):
    for j in range(15):
        if (N == c * i + d * j):
            result = True
            break

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


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

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

    print('No')
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())

four = 0

while 4*four <= N:
    X = N - 4*four
    if X % 7 == 0:
        print("Yes")
        exit()
    four += 1

print("No")

Submission status: Accepted

Solution code:
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n = ni()
    for i in range(100):
        for j in range(100):
            if i * 4 + j * 7 == n:
                print('Yes')
                return
    print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

	for i in range(26):
		for j in range(15):
			if 4 * i + 7 * j == N:
				is_able = True
				break

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

  
if __name__ == "__main__":
  	main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if n%4 == 0 or n%7 == 0:
    print('Yes')
else:
    for i in range(n//4+1, 0, -1):
        j = 0
        while i*4+j*7 < n:
            j += 1
        if i*4+j*7 == n:
            print('Yes')
            sys.exit()
    print('No')

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

Submission status: Accepted

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

if not f:
  print('No')

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [int(input()) for _ in range(n)]

n = int(input())

l = []
for i in range(100//4):
    for j in range(100//7):
        if n == i*4+j*7:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [int(input()) for _ in range(n)]

n = int(input())

l = []
for i in range(100//4):
    for j in range(100//7):
        l.append(i*4+j*7)
if n in l:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())

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

print('No')

Submission status: Accepted

Solution code:
N=int(input())

flag=False
for i in range(100):
    if ((N-4*i)%7==0) and ((N-4*i)/7>=0):
        flag=True
print("Yes" if flag else "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())
cnt=0
for x in range(n):
    for y in range(n):
        if x*4+y*7==n:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

if N >= (4-1) * (7-1):
  print("Yes")
elif N in [4, 7, 8, 11, 12, 14, 15, 16]:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N = int(input())

flg = False

a = int(N/4)
b =int(N/7)

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

Submission status: Accepted

Solution code:
N = int(input())

ans = "No"

for four in range(N//4 + 1):
  if (N - four * 4)%7 == 0:
    ans = "Yes"
    break
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
flag = False
for a in range(25):
  for b in range(14):
    if 4*a+7*b==N:
      flag = True

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def resolve():
    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
    print("Yes" if flag == 1 else "No")
resolve()

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
Flag = False
for Cake in range(0,26):
    for Doughnut in range(0,16):
        if 4*Cake+7*Doughnut==N:
            Flag = True
            break
    if Flag:
        break
if Flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input());print('NYoe s'[n not in [1,2,3,5,6,9,10,13,17]::2])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
n = int(s)

price = 0
in_four = 0
in_seven = 0
check = False

for i in range(30):
    price = 0
    price += i * 4
    if price == n:
        check = True
        break
    for j in range(20):
        price += j * 7
        if price == n:
            check = True
            break
        if price > n:
            break

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

Submission status: Accepted

Solution code:
import math
n = int(input())
# 4, 7
f = []
s = []
tmp = 0
ans = 0
a = math.floor(n/4)
b = math.floor(n/7)
cnt = 0
for i in range(a):
  f.append(4)
if (n % 4) == 0:
  cnt = 1
for i in range(0, len(f)):
  ans = (n-4*i) % 7
  if ans == 0:
    cnt = 1
    break
  ans = 0
if cnt == 1:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n = int(input())

ans = False
for d in range(0, (n + 1), 7):
    if (n - d) % 4 == 0:
        ans = True
        break
print('Yes' if ans else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

n = int(input())

a = 0

while(1):
    tmp = n - 7*a
    if tmp % 4 == 0:
        print("Yes")
        exit()
    a += 1
    if a*7 > n:
        print("No")
        exit()

Submission status: Accepted

Solution code:
N = int(input())

max_a = 100 // 4
max_b = 100 // 7
A = False

for a in range(max_a+1):
    if A == True:
        break
    for b in range(max_b+1):
        total = a*4 + b*7
        if total == N:
            A = True
            break
        if total != N:
            A = False
            continue
            
if A == True:
    print('Yes')
if A == False:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
quotient = n // 4
rep = [4*i for i in range(quotient+1)]
flag = False
while rep[0] <= n:
  if n in rep:
    print('Yes')
    flag = True
    break
  rep = [7+ele for ele in rep]

if not flag:
  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())
p = [i for i in range(101)]
q = [i for i in range(101)]
ans = 'No'

for a in p:
    for b in q:
        if 4*a+7*b == N:
            ans = 'Yes'
            break
        else:
            pass
print(ans)

Submission status: Accepted

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

# B - Cakes and Donuts /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点: 200点

# 問題文
# ABC 洋菓子店では, 1個 4 ドルのケーキと 1 個 7 ドルのドーナツが売られている.
# このとき, 合計金額が Nドルとなる買い方はあるか, 判定せよ. ただし, 同じ商品を二個以上買っても良く, 買わない商品があっても良いものとする.

# 制約
#     Nは 1 以上 100以下の整数

# 入力
# 入力は以下の形式で標準入力から与えられる.
# N

# 出力
# 合計が Nドルとなる買い方がある場合 Yes, そうでない場合 No と出力せよ.

# 入力例 1
# 11

# 出力例 1
# Yes

# ケーキを 1個, ドーナツを 1 個買えば合計 4+7=11ドルとなる.

# 入力例 2
# 40

# 出力例 2
# Yes

# ケーキを 10個買えば 4×10=40ドルとなる.

# 入力例 3
# 3

# 出力例 3
# No

# ケーキの値段は 4ドル, ドーナツの値段は 7 ドルと, どちらも 3 ドルより高いためそのような買い方は存在しない. 


def calculation(lines):
    N = int(lines[0])
    result = 'No'
    for i in range(25):
        for j in range(15):
            if i*4 + j*7 == N:
                result = 'Yes'
    return [result]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['11']
        lines_export = ['Yes']
    if pattern == 2:
        lines_input = ['40']
        lines_export = ['Yes']
    if pattern == 3:
        lines_input = ['3']
        lines_export = ['No']
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    if len(args) == 1:
        mode = 0
    else:
        mode = int(args[1])
    return mode


# 主処理
def main():
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding: utf-8
import math
#N, M = map(int,input().split())
N = int(input())
#K = int(input())
#S = input()
ans = 0
flg = True
#l = list(map(int,input().split()))
#A = list(map(int,input().split()))
for i in range(N//4+1):
    amari = N - 4*i
    if amari%7 == 0:
        print("Yes")
        flg = False
        break
if flg:
    print("No")

Submission status: Accepted

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

C_list=[]

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

cnt = 0
for i in range(len(C_list)):
  if C_list[i] == N:
    cnt += 1

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

Submission status: Accepted

Solution code:
a=int(input())
result=[]
for i in range(26):
    for j in range(26):
        result.append(i*4+j*7)

if a in result:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

def dfs(total):
    if total>=n:
        if total==n:
            print('Yes')
            exit()
        return
    dfs(total+4)
    dfs(total+7)

dfs(0)
print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#import sys
#import numpy as np
import math
#from fractions import Fraction
import itertools
from collections import deque
from collections import Counter
#import heapq
from fractions  import gcd
#input=sys.stdin.readline
import bisect
n=int(input())
i=0
while True:
    if i*4>n:
        print("No")
        break
    if (n-i*4)%7==0:
        print("Yes")
        break
    i+=1

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
x = int(input())

combination = []
for i in range(26):
  for j in range(15):
    total = i*4 + j*7
    combination.append(total)
print('Yes' if x in combination else 'No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())

A = list(range(4, 101, 4))
B = list(range(7, 101, 7))

is_made = False

if N in A or N in B:
    is_made = True
else:
    for a in A:
        for b in B:
            if a+b > N:
                break
            elif a+b == N:
                is_made = True
                break

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    n = int(input())
    num = 0
    while num <= n:
        if (n - num) % 7 == 0:
            print('Yes')
            sys.exit()
        num += 4
    print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

lst = []

for i in range(26):
    for j in range(15):
        if i*4+j*7 > 100:
            break
        else:
            lst.append(i*4+j*7)


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

Submission status: Accepted

Solution code:
fo=0
fou=[0]
se=0
sev=[0]
fl=False
while fo<100:
  fo+=4
  fou.append(fo)
while se<100:
  se+=7
  sev.append(se)
n=int(input())
for i in fou:
  for j in sev:
    if n==i+j:
      fl=True
      print("Yes")
      break
  if fl:
    break
else:
  print("No")

Submission status: Accepted

Solution code:
def main():
    n=int(input())
    for i in range(26):
        if i*4 <= n and (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(N//4+1):
    if (N-4*i) % 7 == 0:
        print("Yes")
        break
else:
    print("No")

Submission status: Accepted

Solution code:
import math
def main():
  n = int(input())
  flg=0
  for i in range(0,int(n/7)+1):
    j=0
    while 4*j + 7*i <= n:
      if 4*j + 7*i ==n:
        flg=1
      j+=1
  if flg==1:
    print('Yes')
  else:
    print('No')
main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def f(n):
	for i in range(0, n/4 + 1):
		for j in range(0, n / 7 + 1):
			if 4*i + 7 * j == n:
				return True

	return False
print 'Yes' if f(int(raw_input())) else 'No'

Submission status: Accepted

Solution code:
import sys

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

A = [1,2,3,5,6,9,10,13,17]

print('No' if N in A else 'Yes')

Submission status: Accepted

Solution code:
import sys

def I():
    return int(sys.stdin.readline().rstrip())

N = I()

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

Submission status: Accepted

Solution code:
x = int(input())

flag = False
for ia in range(0, int(x/4) + 1):
    for ib in range(0, int(x/7) + 1):
        if 4 * ia + 7 * ib == x:
            flag = True
            break
    if flag:
        break

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

Submission status: Accepted

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

for i in range(0, 26, 1):
  for j in range(0, 16, 1):
    if i * 4 + j * 7 == N:
      print('Yes')
      k = 1
      break
  if k == 1:
    break
else:
  if k != 1:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

l = [0] * 10000
for i in range(0, 100 + 1):
  for j in range(0, 100 + 1):
    # print(f"{i} {j}")
    val = (4 * i) + (7 * j)
    # l.append(val)
    l[val] += 1
# print(max(l))

if l[n] == 0:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
N = int(input())

for n in range(25):
  for m in range(25):
    if n*4+m*7==N:
      print("Yes")
      exit()
      
print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


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

    N = ii()
    A = N // 4 + 1
    B = N // 7 + 1

    for a in range(A):
        for b in range(B):
            if a * 4 + b * 7 == N:
                print('Yes')
                exit()
    else:
        print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())

P = [(a,b) for a in range(N//4+1) for b in range(N//7+1) if 4*a + 7*b == N]

print('No' if len(P)==0 else 'Yes')

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

for i in range(0,(N//4)+2,1):
    if (N-i*4)%7 == 0:
        print("Yes")
        exit()
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')
    exit()
print('No')

Submission status: Accepted

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


if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
n = int(input())
flag = 0
while n>0:
    if n % 4 == 0:
        flag = 1
        break
    n -= 7
    if n == 0:
        flag=1
        break
print('Yes' if flag == 1 else 'No')

Submission status: Accepted

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