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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
max_cake = n//4
max_donut = n//7
ans = "No"
if max_cake != 0 or max_donut != 0:
    for cake in range(0, max_cake+1):
        for donut in range(0, max_donut+1):
            if (cake != 0 or donut != 0):
                if n % (4*cake + 7*donut) == 0:
                   ans = "Yes"
print(ans)

Submission status: Accepted

Solution code:
d=int(input())
no=0
n=int(1+d/7)

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

Submission status: Accepted

Solution code:
N = int(input())
x = 0
result = False
while x < 100:
    d = 0
    sum = 0
    while sum <= N:
        sum = 4*x + 7*d
        if sum == N:
            result = True
            break
        d += 1
    if result == True:
        break
    x += 1

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

Submission status: Accepted

Solution code:
def 解():
    N = int(input())
    def testD(N,iD1,iD2):
        while 0 < N:
            if N % iD1 == 0:
                return True
            else:
                N -= iD2
        return False
    if testD(N,4,7) or testD(N,7,4):
        print("Yes")
    else:
        print("No")
解()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def fits(N):
    answer = 'No'
    for cake in range(0,100,4):
        for donut in range(0,100,7):
            if cake + donut is N:
                answer = 'Yes'
    return answer
if __name__ == '__main__':
    N = int(input())
    print(fits(N))

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
import sys
n = int(input())
a = n // 7

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

Submission status: Accepted

Solution code:
class Solver(object):
    def __init__(self):
        self.valids = self._generate_valid_list()
        self.n = int(input())

    def solve(self):
        if self.n in self.valids:
            print("Yes")
        else:
            print("No")

    def _generate_valid_list(self):
        valids = set()
        for cake in range(26): # 0 .. 25
            for donut in range(16):  # 0 .. 15
                valids.add( (donut*7) + (cake*4) )
        return valids


if __name__ == "__main__":
    s = Solver()
    s.solve()

Submission status: Accepted

Solution code:
n=int(input())
n4=n
n7=n
ans=0

while(1):
    if n4%4==0 or n7%7==0:
        ans=1
        break
    else:
        if n4>7:
            n4-=7
        if n7>4:
            n7-=4
    if n4<=7 and n7<=4:
        break

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())
flg = False
for i in range(26):
    if (N - 4*i) % 7 == 0 and (N - 4*i) >= 0:
        flg = True
print('Yes') if flg else 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 4 * i + 7 * j == n:
      ans = 'Yes'
      break;
print(ans)

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')
            break
    else:
        continue
    break
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#Cakes and Donuts
import sys

N = int(input())

def getAns(n) :
    total = 0
    for i in range(n) :
        for j in range(n) :
            total = i * 4 + j * 7
            if total == n :
                return "Yes"
    return "No"

print(getAns(N))

Submission status: Accepted

Solution code:
n = int(input())

arr = []
for i in range(26):
    for j in range(16):
        arr.append(4*i+7*j)

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

Submission status: Accepted

Solution code:
n= int(input())
if 4*(2*n//7) -n>=0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

ans = 'No'

for n in range(N//7+1):
    if ans == 'Yes':
        break
    for m in range(N//4+1):
        if N == 7*n + 4*m:
            ans = 'Yes'
            break

print(ans)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
count=0
for i in range(26):
  for j in range((100-4*i)//7+1):
    M = N-4*i-7*j
    if(M==0):
      print('Yes')
      count+=1
      break
  if(count==1):
    break
if(count==0):
  print('No')

Submission status: Accepted

Solution code:
N = int(input())

amount = 0
result = False

i_max = int(N/4) + 1
y_max = int(N/7) + 1


for i in range(0, i_max) :
    for j in range(0, y_max) :
        cake   = 4 * i
        donuts = 7 * j
        amount = cake + donuts

        if amount == N:
            result = True
            break

    else:
        continue
    break

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

Submission status: Accepted

Solution code:
N = int(input())

maxI = (N // 4)+1 
maxJ = (N // 7)+1

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

Submission status: Accepted

Solution code:
n=int(input())
while(True):
    if(n%4==0 or n%7==0):
        print('Yes')
        exit()
    elif(n<4):
        print('No')
        exit()
    else:
        n-=7

Submission status: Accepted

Solution code:
n = int(input())

while True:
  if n%4==0 or n%7==0:
    print('Yes')
    exit()
  elif n<4:
    print('No')
    exit()
  else:
    n-=7

Submission status: Accepted

Solution code:
n = int(input())

a = n
ans = 0
while a >= 0:
    if a % 4 == 0:
        print("Yes")
        ans = 1
        break
    a -= 7
a = n
if ans == 0:
    while a >= 0:
        if a % 7 == 0:
            print("Yes")
            ans = 1
            break
        a -= 4
if ans == 0:
    print("No")

Submission status: Accepted

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

N = int(input())

def iter(n):
    if n == 0:
        print("Yes")
        sys.exit(0)
    elif n > 0:
        iter(n-4)
        iter(n-7)
    else:
        return False

iter(N)
print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

count = 0
for c in range(0, n + 1, 4):
    for cd in range(c, n + 1, 7):
        if cd == n:
            count = 1

print(['No', 'Yes'][count])

Submission status: Accepted

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

LI = [0, 4, 7, 8, 12, 14, 16, 20, 21, 24, 11, 15, 19, 23, 27, 18, 22, 26, 25]

def main():
    n = int(input())
    print("Yes" if n % 28 in LI else "No")

main()

Submission status: Accepted

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


main()

Submission status: Accepted

Solution code:
def check(n):
    if n == 0:
        return True
    if 0 > n:
        return False
    return any([check(n - 4), check(n - 7)])


def main():
    if check(int(input())) is True:
        print('Yes')
    else:
        print('No')


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""AtCoder"""

import sys
input = sys.stdin.readline

l = []
N = int(input())

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

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

Submission status: Accepted

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

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

    ct = [0] * 128

    for i in range(0, 7 * 4, 7):
        for j in range(0, 104, 4):
            ct[i + j] = 1


    print('Yes' if ct[N] == 1 else 'No')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

counter = 0
for number_cake in range(0,N):
	for number_donut in range(0,N):
		if(N == number_cake*4+number_donut*7):
			counter += 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    result = False
    sum = 0
    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")
    exit()


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
memo ={}
for i in range(30):
  for j in range(30):
    memo[7*i+4*j]=1


del memo[0]

print("Yes" if n in memo else "No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#  105 B
N = int(input())
cMax = N // 4
dMax = N // 7
found = False
for c in range(cMax+1):
    for d in range(dMax+1):
        if c*4+d*7==N:
            found = True
            break
    if found: break
#print(c, d)#
if found: print('Yes')
else: print('No')

Submission status: Accepted

Solution code:
a=int(input())
b=[1,2,3,5,6,9,10,13,17]
print("Yes"if a%28 not in b or a>27else"No")

Submission status: Accepted

Solution code:
N = int(input())
div4 = int(N/4) + 1
div7 = int(N/7) + 1

flg = False
for i in range(div4):
  sum = i * 4
  for t in range(div7):
    sum += t * 7
    if(N == sum):
      flg = True
      
      
if(flg):
  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'
print(ans)

Submission status: Accepted

Solution code:

n = int(input())

can = False

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def piyo():
    n = int(input())
    if n>=24:
        if ((n-7)%4==0 or (n-14)%4==0 or (n-21)%4==0 or n%4==0
        or (n-4)%7==0 or (n-8)%7==0 or (n-12)%7==0 or (n-16)%7==0 or (n-20)%7==0 or (n-24)%7==0 or n%7==0):
            print("Yes")
            return
    if n>=21:
        if ((n-7)%4==0 or (n-14)%4==0 or (n-21)%4==0 or n%4==0
        or (n-4)%7==0 or (n-8)%7==0 or (n-12)%7==0 or (n-16)%7==0 or (n-20)%7==0 or n%7==0):
            print("Yes")
            return
    if n>=20:
        if ((n-7)%4==0 or (n-14)%4==0 or n%4==0 or (n-4)%7==0 or (n-8)%7==0 or (n-12)%7==0 or (n-16)%7==0 or (n-20)%7==0 or n%7==0):
            print("Yes")
            return
    if n>=16:
        if ((n-7)%4==0 or (n-14)%4==0 or n%4==0 or (n-4)%7==0 or (n-8)%7==0 or (n-12)%7==0 or (n-16)%7==0 or n%7==0):
            print("Yes")
            return
    if n>=14:
        if ((n-7)%4==0 or (n-14)%4==0 or n%4==0 or (n-4)%7==0 or (n-8)%7==0 or (n-12)%7==0 or n%7==0):
            print("Yes")
            return
    if n>=12:
        if ((n-7)%4==0 or n%4==0 or (n-4)%7==0 or (n-8)%7==0 or (n-12)%7==0 or n%7==0):
            print("Yes")
            return
    if n>=8:
        if ((n-7)%4==0 or n%4==0 or (n-4)%7==0 or (n-8)%7==0 or n%7==0):
            print("Yes")
            return
    if n>=7:
        if ((n-7)%4==0 or n%4==0 or (n-4)%7==0 or n%7==0):
            print("Yes")
            return
    if n>=4:
        if (n%4==0 or (n-4)%7==0 or n%7==0):
            print("Yes")
            return
    print("No")
        
if __name__ == '__main__':
    piyo()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
n = int(input())
for i in range(26):
    for j in range(16):
        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):
    if (n - 4 * i) % 7 == 0:
      print('Yes')
      exit()
print('No')

Submission status: Accepted

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

print("No")

Submission status: Accepted

Solution code:
N = int(input())

a=0
flag = False

while a<=N:
    if (N-a)%7==0:
        flag=True
    a+=4

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

Submission status: Accepted

Solution code:
# coding: utf-8
N = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

if N >= 28:
    print("Yes")
else:
    fou = []
    sev = []
    for num in range(5):
        fou.append(7*(num))
    for num in range(8):
        sev.append(4*(num))
    sum = []
    for i in range(7):
        for j in range(4):
            sum.append(sev[i] + fou[j])
    if N in sum:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
import sys

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

Submission status: Accepted

Solution code:
N=int(input())


def boughter(num):

    if num<-5:

        return
    elif num==0:
        print('Yes')
        exit(0)
    boughter(num-4)
    boughter(num-7)
    return

boughter(N)
print ( 'No' )

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

target = int(sys.stdin.readlines()[0].strip())

value_cake = 4
value_donut = 7
flag = False

for num_cake in range(0, target // value_cake + 1):
  for num_donut in range(0, target // value_donut + 1):
    if num_cake * value_cake + num_donut * value_donut == target:
      flag = True

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

Submission status: Accepted

Solution code:
N = int(input())
list = []
for j in range(26):
    for k in range(16):
        total = 4 * j + 7 * k
        list.append(total)

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

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:
# -*- coding: utf-8 -*-


def main():
    """Function."""
    n = int(input())

    check = set()
    for i in range(26):
        for j in range(15):
            temp = 4 * i + 7 * j
            if temp > 100:
                pass
            else:
                check.add(temp)

    check.remove(0)

    if n in check:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

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:

import sys
N = int(input())
for i in range(0,N+1,4):
    for k in range(0,N+1,7):
        if i + k == N:
            print("Yes")
            sys.exit()
print("No")

Submission status: Accepted

Solution code:
#B Cakes and Donuts
a = int(input())
b = 0
for i in range(a//7+1):
    for j in range(a//4+1):
        if a == i*7+j*4:
            b = 1
if b:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
flag = 0
cou = N//4 +1

if N < 4:
    print("No")

else:
    for i in range(cou):
        N2 = N - 4*i

        if N2 < 0:
            break

        elif N2 % 7 == 0:
            print("Yes")
            flag = 1
            break

        else:
            continue 

    if flag == 0:
        print("No")

Submission status: Accepted

Solution code:
N = int(input())

ans = int(N/4)
count=0
for i in range(ans+1):
    if((N - (ans-i)*4)%7==0):
        print("Yes")
        count+=1
        break
    
if(count!=1):
    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):
        if 4*i + 7*j == N:
            ans = True
if ans:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
list = []
y = 0
while N - 7*y >=0:
    if (N - 7*y)%4 == 0:
        x = (N - 7*y)%4
        list.append(x)
        y +=1
    else:
        y +=1
        continue
        
if list == []:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
L = list(range(0,26))
c = 0
for i in L:
    for j in L:
        if 4*i+7*j==N:
            c+=1
if c>0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

if n < 4: # 最小以下
  print("No")

elif n % 4 == 0 or n % 7 == 0:  # 片方でわる
  print("Yes")
else:
  four_max = n // 4

  m = 1
  ans = False
  while m < four_max + 1:
    if (n - (4*m)) % 7 == 0:
      ans = True
      break
    m = m+1

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

Submission status: Accepted

Solution code:
import sys

targetPrice = int(input())
cakePrice = 4
donutPrice = 7
maxDonutCount = int(targetPrice / 7)

for i in range(maxDonutCount + 1):
    targetCakePrice = targetPrice - (donutPrice * i)
    if targetCakePrice % cakePrice == 0:
        print("Yes")
        sys.exit()
print("No")

Submission status: Accepted

Solution code:
# _*_ coding:utf-8 _*_
#  Atcoder_Beginners_Contest105-B
#  https://beta.atcoder.jp/contests/abc087/tasks/abc105_B

def  existCheck(cakePrice,donutPrice,total):
	buyPattern = "No"
	cakeRange = range(0,(total//cakePrice)+1)
	donutRange = range(0,(total//donutPrice)+1)
	for cake in cakeRange:
		totalPrice = 0
		for donut in donutRange:
			if total-cakePrice*cake-donutPrice*donut == 0:
				buyPattern = "Yes"
				break

	answer = buyPattern
	return answer


if __name__ == '__main__':
	total = int(input())
	cakePrice = 4
	donutPrice = 7
	solution=existCheck(cakePrice,donutPrice,total)
	print(solution)

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 = input()
flg = False
for i in range(0,N+1):
  for j in range(0,N+1):
    if 4*i + j*7 == N:
      flg = True
      print 'Yes'
      break
  if flg == True:
    break
if flg==False:
  print 'No'

Submission status: Accepted

Solution code:
N=int(input())
fourK = 0
fourLen=[]
sevenK = 0
sevenLen=[]
while fourK <= N:
    fourLen.append(fourK)
    fourK += 4
while sevenK <= N:
    sevenLen.append(sevenK)
    sevenK += 7
x=fourLen[0] + sevenLen[0]
for f in fourLen:
    for s in sevenLen:
        if N == f + s:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

for x in range(100):
    for y in range(100):
        t = 4*x + 7*y
        if t == n :
            print("Yes")
            exit(0)

print("No")

Submission status: Accepted

Solution code:
n = int(input())

count_of_donut = n // 7
result = False
for i in range(count_of_donut + 1):
    rest = n - i * 7
    if rest % 4 == 0:
        result = True

        break

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

Submission status: Accepted

Solution code:
import sys
# N,M = [int(n) for n in input().split()]
# S = str(input())
# T = str(input())

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

Submission status: Accepted

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

for i in range(26):
    for t in range(16):
        if i*4 + t*7 == N:
            count += 1
            break

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

Submission status: Accepted

Solution code:
n=int(input())

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

Submission status: Accepted

Solution code:
n = int(input())
cnt = False
for i in range (26):
  for j in range (19):
    s = i*4 + j*7
    if s == n:
      cnt = True
      break
  if cnt:
    break
#print(n, cnt, i, j)

#if cnt == True: 以外に下の書き方もあり
if cnt:
  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())
f = 0

if N % 4 == 0 or N % 7 == 0:
    f = 1
else:
    while N > 4:
        N -= 4
        if N % 7 == 0:
            f = 1
            break

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

Submission status: Accepted

Solution code:
N = int(input())

def searcher(n):
	a, b = 0, 0
	while b*7 <= n:
		if (b*7) == n:
			return True
		a = 0
		while a*4 + b*7 <=n:
			if a*4 + b*7 == n :
				return True
			a += 1
		b += 1
	else:
		return False


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

Submission status: Accepted

Solution code:
n=int(input())

list=[]
for i in range(100):#cakes
    for j in range(100):#donuts
        cost=4*i+7*j
        if cost<=100:
            list.append(cost)

ans=0
for i in range(len(list)):
  if n==list[i]:
    ans=1
    
print('Yes' if ans==1 else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

yes_or_no = False
for i in range(15):
    for j in range(26):
        if 7 * i + 4 * j == n:
            yes_or_no = True

            break

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

Submission status: Accepted

Solution code:
N = int(input())

def main():
    l = [x + y for x in range(N + 1) if x % 4 == 0
               for y in range(N + 1) if y % 7 == 0]
    l = list(set(l))
    ans = "Yes" if l.count(N) else "No"
    print(ans)

if __name__ == "__main__":
    main()