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.

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

Solution (Python):
n = int(input())
li = [1,2,3,5,6,9,10,13,17]

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

Solution (Python):
n = int(input())

ans = "No"

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

Solution (Python):
N=int(input())
for x in range((N//4)+1):
    md=N-4*x
    if md%7==0:
        y=md//7
        if 4*x+7*y==N and x>=0 and y>=0:
            print("Yes")
            exit()
print("No")

Solution (Python):




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

    for i in range(26):
        if (n-i*4) % 7 == 0 and n - i * 4 >= 0:
            print("Yes")
            break

    else:
        print("No")


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
Flag = False
for i in range(26):
    K = N - 4*i
    if K >= 0:
        if K%7 == 0:
            Flag = True
if Flag == True:
    print('Yes')
else:
    print('No')

Solution (Python):
n=int(input())
count=0
for i in range(n):
  for j in range(n):
    if 4*i + 7*j ==n:
      count=1

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

Solution (Python):
from collections import defaultdict
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
AtoZ = [chr(i) for i in range(65,65+26)]
atoz = [chr(i) for i in range(97,97+26)]

def inpl(): return list(map(int, input().split()))
def inpl_s(): return list(input().split())

N = int(input())

while True:
	if N < 0:
		break
	elif N%4 == 0:
		print('Yes')
		sys.exit()
	N -= 7

print('No')

Solution (Python):
def fa(): 
    global ans
    print(ans)
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
N = getN()

ans = "No"
maxn = N//4 + 1

for i in range (maxn):
    if (N-4*i) % 7 == 0:
        ans = "Yes"

fa()

Solution (Python):
N = int(input())

Ans = "No"
for i in range(20):
    for j in range(30):
        if i*7 + j*4 == N:
            Ans = "Yes"

print(Ans)

Solution (Python):
n = int(input())

while 0 <= n:
    if n%4 == 0:
        print("Yes")
        exit()
    else:
        n -= 7
print("No")

Solution (Python):


def solve(n):
    for i in range(30):
        for k in range(20):
            if i * 4 + 7 * k == n:
                print('Yes')
                return

    print('No')
    return


if __name__ == '__main__':
    n = int(input())
    solve(n)

Solution (Python):
N = int(input())

import math
def f():
    for i in range(math.floor(N / 7) + 1):
        if 0 == (N - i * 7) % 4: return True
    return False

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

Solution (Python):


from collections import deque
import itertools as it
import sys
import math

sys.setrecursionlimit(10000000)

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

Solution (Python):
N=int(input().strip())
x=0
while 4*x<=N:
    if (N-x*4)%7==0:
        print("Yes")
        break
    x+=1
else:
    print("No")

Solution (Python):
N = int(input())

four = [4*i for i in range(26)]
seven = [7*i for i in range(15)]

exist = False
for f in four:
    for s in seven:
        sm = f+s
        if sm == N:
            exist = True
            
if exist:
    print("Yes")
else:
    print("No")

Solution (Python):
N = input()
ok = [False for _ in xrange(N+1)]
for i in xrange(4, N+1, 4):
    ok[i] = True
for i in xrange(7, N+1, 7):
    ok[i] = True
for i in xrange(N+1):
    if ok[i] and i + 4 <= N:
        ok[i+4] = True
    elif ok[i] and i + 7 <= N:
        ok[i+7] = True
if ok[N]:
    print "Yes"
else:
    print "No"

Solution (Python):
n = int(input())

flag = False

for i in range(0,101,7):
    for j in range(0,101,4):
        if n == i + j:
            flag = True
            break
    if flag:
        break
if flag:
    print("Yes")
else:
    print("No")

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

Solution (Python):
import sys
import math
import collections
import itertools
import array
import inspect


sys.setrecursionlimit(10000)



def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))



def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]




dp = None


def main():
    l = []

    for i in range(100):
        for j in range(100):
            if i * 4 + j * 7 <= 100:
                l.append(i * 4 + j * 7)

    N = int(input())

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


main()

Solution (Python):
n = int(input())
flag = False
for i in range(n + 1):
    for j in range(n + 1):
        if i * 4 + j * 7 == n:
            flag = True

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

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

Solution (Python):
N = int(input())

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

print("No")

Solution (Python):
n = int(input())

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

if n in no_list:
    print('No')
else:
    print('Yes')

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

Solution (Python):
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")

Solution (Python):
N = int(input())
b = 1
for i in range(25):
    b |= b << 4
for i in range(15):
    b |= b << 7
print('Yes' if (b >> N) & 1 else 'No')

Solution (Python):
N = int(input())

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

Solution (Python):
n = input()
print "Yes" if n in [4*x+7*y for x in range(100) for y in range(100)] else "No"

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

print("No")

Solution (Python):
N = input()
for i in range(100):
  for j in range(100):
    if 4*i+7*j==N:
      print "Yes"
      exit(0)
print "No"

Solution (Python):
import sys

N = int(input())
for x in range(100):
    for y in range(100):
        if x * 4 + y * 7 == N:
            print('Yes')
            sys.exit(0)

print('No')

Solution (Python):
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

n = ni()

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

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