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())
l=[0,7,14,21]
count=0
for i in l:
    if n%7==0:
        count+=1
        break
    elif (n-i)>0 and (n-i)%4==0:
        count+=1
        break
    else:
        count=0
print('Yes' if count>0 else 'No')

Submission status: Accepted

Solution code:
N=int(input())
n=[]
for i in range(0,26):
  for j in range(0,16):
    n.append(4*i+7*j)
if any(N==M for M in n):
  print("Yes")
else:
  print("No")

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

flag = False

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

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

Submission status: Accepted

Solution code:
n = int(input())
ans  = [True for i in range(26) for j in range(15) if 4*i+7*j==n]
print('Yes' if sum(ans)>=1 else 'No')

Submission status: Accepted

Solution code:
N=int(input())
output='No'
i=0
while i*4<=N:
  if (N-i*4)%7==0:
    output='Yes'
  i+=1
print(output)

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

if flag:
    print("Yes")
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

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    if(N<4):
        print('No')
        return
    if(N%4==0 or N%7==0):
        print('Yes')
        return
    
    tmp = 0
    while(N>tmp):
        if((N-tmp)%4==0):
            print('Yes')
            return
        tmp = tmp+7
    
    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 i*4 + j*7 == n:
      print("Yes")
      exit()
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())}
set = {4*a + 7*b for a in range(100) for b in range(100)}
if set & n:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N = int(input())

max_4 = int(N / 4)
max_7 = int(N / 7)

cost_list = []
for i in range(max_7 + 1):
    for j in range(max_4 + 1):
        cost = 7 * i + 4 * j
        cost_list.append(cost)


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

Submission status: Accepted

Solution code:
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

n = ni()

def check(cost):
    if cost == n:
        return 1
    if cost > n:
        return 0

    return check(cost+4) or check(cost+7)

if check(0) == 1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    n = int(input())
    i = 0
    j = 0
    flg = 0
    while 4 * i <= n:
        j = 0
        while 4 * i + 7 * j <= n:
            if 4 * i + 7 * j == n:
                flg = 1
                break
            j += 1
        if flg:
            pass
        i += 1

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    for i in range(n + 1):
        for j in range(n + 1):
            if i * 7 + j * 4 == n:
                print("Yes")
                exit()
    print("No")


if __name__ == '__main__':
    slove()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
def just(n,sho):
    for i in range(sho+1):
        m=4*i
        while m!=n:
            m+=7
            if m>n:
                break
            if m==n:
                return print("Yes")
    return print("No")

if n%4==0 or n%7==0 or n%11==0:
    print("Yes")
else:
    just(n, n//4)

Submission status: Accepted

Solution code:
N = int(input())

cnt = 0
x = 0
while N - 4*x >= 0:
    if (N - 4*x) % 7 == 0:
        print('Yes')
        break
    x += 1
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

N = int(input())
for c in range(0,26):
    for d in range(0,15):
        if c * 4 + d * 7 == N:
            print('Yes')
            sys.exit()
print('No')

Submission status: Accepted

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

for i in range(26):
    for j in range(17):
        z = price - (4*i + 7*j)
        if z == 0:
            cnt += 1
            break

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

Submission status: Accepted

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

for i in range(26):
    for j in range(17):
        z = price - (4*i + 7*j)
        if z == 0:
            cnt += 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

for a in range(100):
    for b in range(100):
        if a * 4 + b * 7 == N:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

max_cakes = N // 4
max_donuts = N // 7

Found = False

for i in range(max_cakes + 1):
    for j in range(max_donuts + 1):
        if i * 4 + j * 7 == N:
            Found = True
            break
    else:
        continue
    break

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())

a=False

for i in range(N):
    for j in range(N):
        price=4*i+7*j
        if price == N:
            a=True

if a:
    print('Yes')
else:
    print('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"
    break
print(ans)

Submission status: Accepted

Solution code:
N=int(input())

A=[]
B=[]
C=[]
for i in range(1,26):
    A.append(i*4)
for i in range(1,16):
    B.append(i*7)
for i in range(1,26):
    for j in range(1,16):
        C.append(4*i+7*j)
        
D=A+B+C

if D.count(N)>=1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

if __name__ == "__main__":
    CakesandDonuts()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
can_make = [False for i in range(101)]
four = [4*i for i in range(26)]
seven = [7*i for i in range(15)]

for f in four:
    for s in seven:
        if f+s <= 100:
            can_make[f+s]=True

if can_make[n]:
    print("Yes")

else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())
ret = "No"
for c_i in range(N // 4 + 1):
    for d_i in range(N // 7 + 1):
        total = 4 * c_i + 7 * d_i
        if total == N:
            ret = "Yes"
            break
print(ret)

Submission status: Accepted

Solution code:
N = int(input())
ret = "No"
for c_i in range(N + 1):
    for d_i in range(N + 1):
        total = 4 * c_i + 7 * d_i
        if total == N:
            ret = "Yes"
            break
print(ret)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

    break
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
if N % 4 == 0 or N % 7 == 0:
    print("Yes")
    exit(0)
else:
    for _ in range(N // 4):
        N -= 4
        if N % 7 == 0:
            print("Yes")
            exit(0)

print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n =int(input())

cupper=n//4
dupper = n//7
flag = False

for x in range(cupper+1):
    for y in range(dupper+1):
        if (4 * x + 7 * y == n):
            flag = True
            break
if flag:
    print ("Yes")
else:
    print ("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
M=[0]*101

for i in range(26):
  for j in range(15):
    if 4*i+7*j<=100:
      M[4*i+7*j]=1
#print(M)

print("Yes" if M[int(input())]==1 else "No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]

N = int(input())

for i in range(100):
    cnt = 0
    cnt += i*4
    for j in range(100):
        cnt += j*7
        if cnt>N:
            break
        if cnt==N:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

Solution code:
N = int(input())

ans = "No"
if N < 4:
    ans = "No"
elif N%4 == 0 or N%7 == 0:
    ans = "Yes"
else:
    for a in range(0, 25):
        for b in range(0, 15):
            if 4*a + 7*b == N:
                ans = "Yes"
                break
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())

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:
# ABC105b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

n = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())
swi = "No"
for a in range(100):
    b = n - 4*a
    if b % 7 == 0 and b >= 0:
            swi = "Yes"
            break
print(swi)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import sys
n = int(input())
max7 = math.ceil(n / 7)
for m in range(max7+1):
    if (n-7*m) >= 0 and (n-7*m)%4 == 0:
        print('Yes')
        sys.exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
N = int(input())
N2 = N
while(N >= 0):
  if N%4 == 0 or N%7 == 0:
    print('Yes')
    sys.exit()
  else:
    N -=4
while(N >= 0):
  if N%4 == 0 or N%7 == 0:
    print('Yes')
    sys.exit()
  else:
    N -=7
print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
PRICE_CAKE = 4
PRICE_DOUGHNUT = 7

n = int(input())
max_cakes = n // PRICE_CAKE

valid = False
for i in range(max_cakes + 1):
  n_left = n - i * PRICE_CAKE
  if n_left % PRICE_DOUGHNUT == 0:
    valid = True
    break
    
print("Yes" if valid else "No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
ans=False
for i in range(100//4+1):
  if 4*i>n:
    break
  for j in range(100//7+1):
    if 4*i+7*j>n:
      break
    elif 4*i+7*j==n:
      ans=True
      break
    
print(("No","Yes")[ans])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
a = 4
b = 7
count = 0
for i in range(0, (N // a) + 1):
    for j in range(0, (N // b) + 1):
        if a * i + b * j == N:
            count += 1
        else:
            pass

if count >= 1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
A = -(-n//4)
B = -(-n//7)
for a in range(A+1):
    for b in range(B+1):
        if a*4 + b*7 == n:
            print('Yes')
            break
    else:
        continue
    break
else:
    print('No')

Submission status: Accepted

Solution code:
N=int(input())
flg=False
m=N//4
for a in range(0,m+1):
    for b in range(0,m+1):
        L=a*4+b*7
        if L==N:
            flg=True
if flg:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
from math import floor
import sys
n = int(input())

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

print("No")

Submission status: Accepted

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

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

print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print('Yes' if [4 * i + 7* j for i in range(101) for j in range(101)].count(int(input())) else 'No')

Submission status: Accepted

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

print(flag)

Submission status: Accepted

Solution code:
N = int(input())
L=[4*x+7*y for x in range(26) for y in range(15)]
print("Yes" if N in L else "No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
if N % 4 == 0 or N % 7 == 0:
    print('Yes')
    exit()
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())
count = 0
for x in range(N):
  for y in range(N):
    if 4*x+7*y == N:
      count += 1
if count > 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N = int(input())

#4*a + 7*b == N ???

counter = 0
for a in range(N//4+1):
  for b in range(N//7+1):
    if 4*a + 7*b == N:
      counter += 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

flag = 0

for i in range(100):
    if flag == 1:
        break
    for j in range(100):
        if flag == 1:
            break
        tmp = 4*i + 7*j
        if tmp == N:
            print("Yes")
            flag = 1
if flag == 0:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
ans_list = []
for f in range(26):
    for s in range(15):
        ans_list.append(4 * f + 7 * s)

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

Submission status: Accepted

Solution code:
N = int(input())
cake = 7
donut = 4
count = 0
for i in range(16):
    for j in range(26):
        if N == cake*i + donut*j:
            count = count + 1
        else:
            continue

if count > 0:
    print('Yes')
elif count == 0:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
dp = [0 for i in range(100)]
dp[6] = 1
dp[3] = 1
for i in range(100):
  if i>=4 and dp[i-4]==1:
    dp[i] = 1
  if i>=7 and dp[i-7]==1:
    dp[i] = 1
if dp[int(input())-1]==1:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n = int(input())
c = 25
d = 14
judge = "No"

for i in range(d + 1):
  for j in range(c + 1):
    payment = 7 * i + 4 * j
    if payment == n:
      judge = "Yes"

print(judge)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
print('Yes' if [4*x+7*y for x in range(N) for y in range(N)].count(N)>0 else 'No')

Submission status: Accepted

Solution code:
N = int(input())

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

print("No")

Submission status: Accepted

Solution code:
N = int(input())

for i in range(4, N + 1, 4):
    d = N % i
    if d == 0:
        print("Yes")
        exit()

    if d % 7 == 0:
        print("Yes")
        exit()

for i in range(7, N + 1, 7):
    d = N % i
    if d == 0:
        print("Yes")
        exit()

    if d % 4 == 0:
        print("Yes")
        exit()

print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


class AtCoder:
    def main(self):
        N = int(input())
        for d in range(N//7 + 1):
            for c in range(N//4 + 1):
                if d*7 + c *4 == N:
                    print('Yes')
                    exit()
        print('No')


# Run main
if __name__ == '__main__':
    AtCoder().main()

Submission status: Accepted

Solution code:
N = int(input())

cash_cake = 4
cash_donut = 7

for cake in range(0,26):
  for donut in range(0,15):
    payment = cake*cash_cake + donut*cash_donut
    if payment == N:
      print('Yes')
      exit()

print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(200000)
input = sys.stdin.readline

N, = map(int, input().split())

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

print("No")

Submission status: Accepted

Solution code:
n=int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


n = int(input())

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())
c = []

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

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

Submission status: Accepted

Solution code:
N = 0
def f(x,y,total):
    total = x*4 + y*7

    if total == N:
        print("Yes")
        exit()
    elif total < N:
        f(x+1,y,total)
        f(x,y+1,total)

N = int(input())
f(0,0,0)
print("No")

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    N = int(input())
    for i in range(0,101,4):
        for j in range(0,101,7):
            if i+j == N:
                print("Yes")
                return
    print("No")

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

Flag = False
total = N
for i in range(N):
    total = N
    if total != 0:
        total -= 4 * i
    else:
        Flag = True
        break
    for j in range(N):
        if total != 0:
            total -= 7 * j
        else:
            Flag = True
            break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
for _ in range(100):
    if n<=3:
        print('No')
        break
    else:
        if n%7==0 or n%4==0:
            print('Yes')
            break
        else:
            n-=4

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    n4 = [4+4*i for i in range(N//4)]
    n7 = [7+7*i for i in range(N//7)]
    ok = False
    for t in n4:
        if (N - t) % 7 == 0:
            ok = True
            break
    if not ok:
        for t in n7:
            if (N- t) % 4 == 0:
                ok = True
                break
    
    if ok:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())
n4 = int(n / 4) + 1
n7 = int(n / 7) + 1
hit = False
for f in range(n4):
    for s in range(n7):
        if (n - f * 4 - s * 7 == 0):
            hit = True
if (hit):
    print ("Yes")
else:
    print ("No")