Harryxun/stf_run huggingface dataset:
from collections import deque
N = int(input())
g = [ [] for i in range(N)]
for _ in range(N-1):
  a, b = map(int, input().split())
  g[b-1].append(a-1)
  g[a-1].append(b-1)
visit = [0]*N
q=deque()
a = [0]*N
b = [0]*N
def tansakuf(i):
  visit[i] = 1
  for j in g[i]:
    if visit[j] == 0 and j != i:
      a[j] = a[i] + 1
      q.append(j)
  if len(q) != 0:
    x=q.popleft()
    return tansakuf(x)
tansakuf(0)
def tansakus(i):
  visit[i] = 0
  for j in g[i]:
    if visit[j] == 1 and j != i:
      b[j] = b[i] + 1
      q.append(j)
  if len(q) != 0:
    x=q.popleft()
    return tansakus(x)
tansakus(N-1)
cnt = 0
for i in range(N):
  if a[i] <= b[i]:
    cnt += 1
  else:
    cnt -= 1
if cnt > 0:
  print('Fennec')
else:
  print('Snuke')

### FIXED CODE ###

from collections import deque
N = int(input())
g = [[] for i in range(N)]
for _ in range(N-1):
  a, b = map(int, input().split())
  g[b-1].append(a-1)
  g[a-1].append(b-1)
a = [-1]*N
b = [-1]*N
def bfs(n):
  q=deque()
  q.append(n)
  a[n] = 0
  while len(q):
    x=q.popleft()
    for i in g[x]:
      if a[i]==-1: 
        a[i]=a[x]+1
        q.append(i)
bfs(0)
def bfs2(n):
  q=deque()
  q.append(n)
  b[n] = 0
  while len(q):
    x=q.popleft()
    for i in g[x]:
      if b[i]==-1: 
        b[i]=b[x]+1
        q.append(i)
bfs2(N-1)
cnt = 0
for i in range(N):
  if a[i] <= b[i]:
    cnt += 1
  else:
    cnt -= 1
if cnt > 0:
  print('Fennec')
else:
  print('Snuke')
w,h,n = map(int,input().split())
x_min = 0
y_min = 0
x_max = w
y_max = h
for i in range(n):
  x,y,a = map(int,input().split())
  if a == 1:
    if x_min < x:
      x_min = x
  elif a == 2:
    if x_max > x:
      x_max = x
  elif a == 3:
    if y_min < y:
      y_min = y
  elif a == 4:
    if y_max > y:
      y_max = y
S = (x_max-x_min)*(y_max-y_min)
if S < 0:
  print(0)
else:
  print(S)


### FIXED CODE ###

a,b,c = map(int,input().split())
if a+b == c or a+c == b or b+c == a:
  print("Yes")
else:
  print("No")
a, b = map(int, input().split())

mod = a*b/2
if c == 1:
  print('Odd')
else c == 0:
  print('Even')

### FIXED CODE ###

a, b = map(int, input().split())

mod = (a*b)%2
if mod == 1:
    print('Odd')
else:
    print('Even')
s = sorted(input())

if s[0] == s[1] and s[2] == s[3] and s[0] != s[2]:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

n = int(input())
p = [int(i) for i in input().split()]

count = 0

for i in range(n-2):
    if p[i] <= p[i+1] < p[i+2] or p[i+2] <= p[i+1] < p[i] or (p[i] == p[i+2] and p[i+1] < p[i]):
        count += 1

print(count)
k,s = map(int,input().split())

count = 0
for x in range(k+1):
  a = s-k-x
  a = 0 if a < 0 else a
  for y in range(a,k+1):
    if x + y > s:
      break
    for z in num:
      if x + y + z == s:
        count += 1
      elif x + y + z > s:
        break

print(count)

### FIXED CODE ###

k,s = map(int,input().split())

count = 0
for x in range(k+1):
  for y in range(k+1):
    a = s - x - y
    if a >= 0 and a <= k:
      count += 1

print(count)
import sys

a = int(input())
b = int(input())
c = int(input())

if (a == 5 or a == 7):
  if (b == 5 or b == 7):
    if (c == 5 or c == 7):
      d = a * b * c
      if (d == 175):
        print("YES")
      else: print("NO")
    else: print("NO")
  else: print("NO")
else:
  print("NO")

### FIXED CODE ###

import sys

a, b, c = map(int,input().split())

if (a == 5 or a == 7):
  if (b == 5 or b == 7):
    if (c == 5 or c == 7):
      d = a * b * c
      if (d == 175):
        print("YES")
      else: print("NO")
    else: print("NO")
  else: print("NO")
else:
  print("NO")
def diikstraMethd(G, s):
    # ?????????
    n = len(G)
    # White:0 Gyay:1 Black:2
    color = [0 for _ in range(n)]
    d = [INF for _ in range(n)]
    p = [None for _ in range(n)]

    d[s] = 0

    while True:
        mincost = INF
        for i in range(n):
            if color[i] != 2 and d[i] < mincost:
                mincost = d[i]
                u = i

        if mincost == INF: break

        color[u] = 2

        for v in range(n):
            if color[v] != 2 and M[u][v] != INF:
                if d[u] + M[u][v] < d[v]:
                    d[v] = d[u] + M[u][v]
                    p[v] = u
                    color[u] = 1

    return d

if __name__ == '__main__':
    n = int(input())
    M = [[INF for _ in range(n)] for i in range(n)]
    for _ in range(n):
        tmp = list(map(int, input().split()))
        u = tmp.pop(0)
        k = tmp.pop(0)
        for _ in range(k):
            v = tmp.pop(0)
            c = tmp.pop(0)
            M[u][v] = c
    d = diikstraMethd(M, 0)


    for i in range(n):
        print('{0} {1}'.format(i, d[i]))

### FIXED CODE ###

INF = 1000000


def diikstraMethd(G, s):
    # ?????????
    n = len(G)
    # White:0 Gyay:1 Black:2
    color = [0 for _ in range(n)]
    d = [INF for _ in range(n)]
    p = [None for _ in range(n)]

    d[s] = 0

    while True:
        mincost = INF
        for i in range(n):
            if color[i] != 2 and d[i] < mincost:
                mincost = d[i]
                u = i

        if mincost == INF: break

        color[u] = 2

        for v in range(n):
            if color[v] != 2 and M[u][v] != INF:
                if d[u] + M[u][v] < d[v]:
                    d[v] = d[u] + M[u][v]
                    p[v] = u
                    color[u] = 1

    return d


if __name__ == '__main__':
    n = int(input())
    M = [[INF for _ in range(n)] for i in range(n)]
    for _ in range(n):
        tmp = list(map(int, input().split()))
        u = tmp.pop(0)
        k = tmp.pop(0)
        for _ in range(k):
            v = tmp.pop(0)
            c = tmp.pop(0)
            M[u][v] = c
    d = diikstraMethd(M, 0)

    for i in range(n):
        print('{0} {1}'.format(i, d[i]))
import sympy

a = int(input())

test_list = sympy.divisors(a)
test_list_modify = [i-1 for i in test_list if i > 2 and a//(i-1) == a%(i-1)]
print(sum(test_list_modify))

### FIXED CODE ###

a = int(input())
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors


test_list = make_divisors(a)
test_list_modify = [i-1 for i in test_list if i > 2 and a//(i-1) == a%(i-1)]
print(sum(test_list_modify))
n=input()
x=input().split()
print(x[-1]-x[0])


### FIXED CODE ###

input()
x=sorted(map(int,input().split()))
print(x[-1]-x[0])
N=int(input())
c=input()

i=0
listNum=[]

for i in range(N):
    w=c.count("W",0,i)
    s=c.count("R",i+1,N)
    listNum.append(max(w,s))
    i+=1
print(min(listNum))

### FIXED CODE ###

X=int(input())

if X>=30:
    print("Yes")
else:
    print("No")
while True:
    (a, op, b) = input().split()
    a = int(a)
    b = int(b)
    if op == '?':
        break
    elif op == '+':
        print(a + b)
    elif op == '-':
        print(a - b)
    elif op == '*':
        print(a * b)
    elif op == '/':
        print(int(a / b))
~                                                                               
~                            

### FIXED CODE ###

while True:
    (a, op, b) = [int(i) if i.isdigit() else i for i in input().split()]
    if op == '?':
        break
    elif op == '+':
        print(a + b)
    elif op == '-':
        print(a - b)
    elif op == '*':
        print(a * b)
    elif op == '/':
        print(a // b)
0 if X < A else 10

### FIXED CODE ###

X,A = map(int,input().split())
 
print(0 if X<A else 10)
N = int(input())
T = []
for _ in range(N):
    T.append(int(input()))

from math import gcd
from functools import reduce


def lcm(x, y):
    return (x * y) // gcd(x, y)


ans = T[0]
for t in T:
    ans = lcm(ans, t)

print(ans)


### FIXED CODE ###

import math


def gcd(x, y):
    while (y):
        x, y = y, x % y
    return x


def lcm(x, y):
    return (x * y) // gcd(x, y)


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

for _ in range(N):
    T.append(int(input()))

ans = T[0]

for t in T:
    ans = lcm(ans, t)

print(ans)
n=int(input())
pirnt(n**3)

### FIXED CODE ###

n=int(input())
print(n**3)
import math

n,xs=map(int,input().split())

x=[abs(int(i)-xs) for i in input().split()]

a=x[0]
for i in range(n):
    a=math.gcd(a,x[i])

print(a)


### FIXED CODE ###

def gcd(a, b):

	while b:

		a, b = b, a % b

	return a

n,xs=map(int,input().split())

x=[abs(int(i)-xs) for i in input().split()]

ans=x[0]
for i in range(n):
    ans=gcd(ans,x[i])

print(ans)
N, M = map(int, input().split())
Alist = [[]]*M
for i in range(M):
  Alist[i] = list(map(str, input().split()))
collect = [False]*N
NP = 0
NAC = 0
for j in range(M):
  if collect[int(Alist[j][0])] == False and Alist[j][1] == 'WA':
    NP += 1
  elif collect[int(Alist[j][0])] == False and Alist[j][1] == 'AC':
    NAC += 1
    collect[int(Alist[j][0])] = True

print(NAC, " ", NP)

### FIXED CODE ###

N, M = map(int, input().split())
Alist = [[]]*M
for i in range(M):
  Alist[i] = list(map(str, input().split()))
collect = [False]*N
NP = 0
NAC = 0
results = [False]*N
for k in range(M):
  if Alist[k][1] == 'AC':
    results[int(Alist[k][0])-1] = True

for j in range(M):
  if Alist[j][1] == 'WA' and results[int(Alist[j][0])-1] == True and collect[int(Alist[j][0])-1] == False:
    NP += 1
  elif collect[int(Alist[j][0])-1] == False and Alist[j][1] == 'AC':
    NAC += 1
    collect[int(Alist[j][0])-1] = True
print(NAC, " ", NP)
n,m = map(int,input().split())
city = [[] for _ in range(n+1)]
ret = ["" for _ in range(m)]
def createSix(s):
    while len(s) != 6:
        s = "0" + s
    return s
for i in range(m):
    a,b = map(int, input().split())
    city[a].append((b, i))
for i in range(m):
    city[i].sort()
print(city)
for i in range(n+1):
    for j in range(len(city[i])):
        ret[city[i][j][1]] = createSix(str(i)) + createSix(str(j+1))
for i in ret:
    print(i)
    

    


### FIXED CODE ###

n,m = map(int,input().split())
city = [[] for _ in range(n+1)]
ret = ["" for _ in range(m)]
def createSix(s):
    while len(s) != 6:
        s = "0" + s
    return s
for i in range(m):
    a,b = map(int, input().split())
    city[a].append((b, i))
for i in range(n+1):
    city[i].sort()
for i in range(n+1):
    for j in range(len(city[i])):
        ret[city[i][j][1]] = createSix(str(i)) + createSix(str(j+1))
for i in ret:
    print(i)
import numpy as np

N, M = map(int, input().split())
stairs_exist = np.ones(N+1)

for c in range(M):
    stairs_exist[int(input())] = 0
    
steps = np.zeros(N+1)
steps[0] = 1
for i in range(N):
    for j in range(i+1, min(N+1, i+3)):
        if stairs_exist[j]:
            steps[j] += steps[i]
            
print(int(steps[-1]))

### FIXED CODE ###

N, M=map(int, input().split())
A = [int(input()) for _ in range(M)]
mod = 10**9 + 7
step = [1]*(N+1)

for a in A:
    step[a]=0
for i in range(2, N+1):
    step[i]=(step[i-1]+step[i-2])%mod*step[i]
print(step[-1])
N, M = map(int, input().split())
LRD = [list(map(int, input().split())) for i in range(M)]


class WeightedUnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n+1)]
        self.rank = [0] * (n + 1)
        self.weight = [0] * (n+1)

    # 検索
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.weight[x] += self.weight[self.par[x]]
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    # 重さの検索
    def weighting(self, x):
        self.find(x)
        return self.weight[x]

    # 併合
    def union(self, x, y, w):
        w -= self.weighting(x)
        w += self.weighting(y)
        x = self.find(x)
        y = self.find(y)

        if self.rank[x] < self.rank[y]:
            self.weight[y] = w
            self.par[y] = w
        else:
            self.weight[y] = -w
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    # 同じ集合に属するか
    def same(self, x, y):
        return self.find(x) == self.find(y)

    # 各頂点間の絶対距離
    def diff(self, x, y):
        return self.weighting(x) - self.weighting(y)


wuf = WeightedUnionFind(N)
for l, r, d in LRD:
    if wuf.same(l, r):
        if wuf.diff(l, r) != d:
            print("No")
            break
    else:
        wuf.union(l, r, d)
else:
    print("Yes")


### FIXED CODE ###

N, M = map(int, input().split())
LRD = [list(map(int, input().split())) for i in range(M)]


class WeightedUnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n+1)]
        self.rank = [0] * (n+1)
        self.weight = [0] * (n+1)

    # 検索
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            y = self.find(self.par[x])
            self.weight[x] += self.weight[self.par[x]]
            self.par[x] = y
            return y

    # 重さの検索
    def weighting(self, x):
        self.find(x)
        return self.weight[x]

    # 併合
    def union(self, x, y, w):
        px = self.find(x)
        py = self.find(y)
        if px != py:
            if self.rank[px] < self.rank[py]:
                self.par[px] = py
                self.weight[px] = w - self.weight[x] + self.weight[y]
            else:
                self.par[py] = px
                self.weight[py] = -w - self.weight[y] + self.weight[x]
                if self.rank[px] == self.rank[py]:
                    self.rank[px] += 1

    # 同じ集合に属するか
    def same(self, x, y):
        return self.find(x) == self.find(y)

    # 各頂点間の絶対距離
    def diff(self, x, y):
        return self.weight[x] - self.weight[y]

wuf = WeightedUnionFind(N)
for l, r, d in LRD:
    if wuf.same(l, r):
        if wuf.diff(l, r) != d:
            print("No")
            break
    else:
        wuf.union(l, r, d)
else:
    print("Yes")
import sys
import numpy as np

h, w = list(map(int, input().split()))
field = [line.rstrip() for line in sys.stdin]

l = [[0] * (w + 2) for _ in [0] * (h + 2)]
r = [[0] * (w + 2) for _ in [0] * (h + 2)]
u = [[0] * (w + 2) for _ in [0] * (h + 2)]
d = [[0] * (w + 2) for _ in [0] * (h + 2)]

for i in range(1, h + 1):
    fi = field[i - 1]
    l_tmp = 0
    li = l[i]
    for j in range(1, w + 1):
        c = fi[j - 1]
        u[i][j] = u[i - 1][j] + 1 if c == '.' else 0
        li[j] = l_tmp = l_tmp + 1 if c == '.' else 0
for i in range(h, 0, -1):
    fi = field[i - 1]
    r_tmp = 0
    ri = r[i]
    for j in range(w, 0, -1):
        c = fi[j - 1]
        d[i][j] = d[i + 1][j] + 1 if c == '.' else 0
        ri[j] = r_tmp = r_tmp + 1 if c == '.' else 0

print(sum(map(np.array, [l, r, u, d])).max() - 3)


### FIXED CODE ###

import sys

h, w = list(map(int, input().split()))
field = [line.rstrip() for line in sys.stdin]

l = [[0] * (w + 2) for _ in [0] * (h + 2)]
r = [[0] * (w + 2) for _ in [0] * (h + 2)]
u = [[0] * (w + 2) for _ in [0] * (h + 2)]
d = [[0] * (w + 2) for _ in [0] * (h + 2)]

for i in range(1, h + 1):
    fi = field[i - 1]
    li = l[i]
    for j in range(1, w + 1):
        c = fi[j - 1]
        u[i][j] = u[i - 1][j] + 1 if c == '.' else 0
        li[j] = li[j - 1] + 1 if c == '.' else 0
for i in range(h, 0, -1):
    fi = field[i - 1]
    ri = r[i]
    for j in range(w, 0, -1):
        c = fi[j - 1]
        d[i][j] = d[i + 1][j] + 1 if c == '.' else 0
        ri[j] = ri[j + 1] + 1 if c == '.' else 0

ans = 0
for i in range(1, h + 1):
    li, ri, ui, di = l[i], r[i], u[i], d[i]
    ans = max(ans, max(li[j] + ri[j] + ui[j] + di[j] for j in range(1, w + 1)))
print(ans - 3)
num,time = map(int, raw_input().split())
t = raw_input().split()
ans = time
for i in range(0,num-1):
  a = int(t[i+1])-int(t[i]) 
	if a < time:
		ans += a
	else:
		ans += time
print ans

### FIXED CODE ###

num,time = map(int, raw_input().split())
t = raw_input().split()
ans = time
for i in range(0,num-1):
	if int(t[i+1])-int(t[i]) < time:
		ans += int(t[i+1])-int(t[i])
	else:
		ans += time
print ans
import sys
from collections import deque
input = sys.stdin.readline
h, w = map(int, input().split())
g = []
for i in range(h):
    g.append(input())

move = ((0, 1), (1, 0), (-1, 0), (0, -1))
ans = 0

for s_x, s_y in  [(i, j) for i in range(h) for j in range(w)]:
    if g[s_x][s_y] == "#":
        continue
    dp = [[0 for i in range(w)] for i in range(h)]
    pre = (-1, -1)
    cur = (s_x, s_y)
    cnt = 0
    queue = deque([(cur, pre, cnt)])
    queue_pop = queue.pop
    queue_append = queue.append
    while queue:
        cur, pre, cnt = queue_pop()
        c_x, c_y = cur
        if g[c_x][c_y] == '#':
          continue
        dp_cnt = dp[c_x][c_y]
        if not dp_cnt or dp_cnt > cnt:
            dp[c_x][c_y] = cnt

            for x, y in move:
                next = (cur[0] + x, cur[1] + y)
                if next == start:
                    continue
                if next != pre and next[0] >= 0 and next[0] < h and next[1] >= 0 and next[1] < w:
                    queue_append([next, cur, cnt + 1])
    ans= max(max([dp[i][j] for i in range(h) for j in range(w)]), ans)


print(ans)


### FIXED CODE ###

import sys
from collections import deque
input = sys.stdin.readline
h, w = map(int, input().split())
g = []
for i in range(h):
    g.append(input())

move = ((0, 1), (1, 0), (-1, 0), (0, -1))
ans = 0

for start in  [[i, j] for i in range(h) for j in range(w)]:
    if g[start[0]][start[1]] == "#":
        continue
    dp = [[0 for i in range(w)] for i in range(h)]
    pre = [-1, -1]
    cur = start
    cnt = 0
    queue = deque([[cur, pre, cnt]])
    while queue:
        cur, pre, cnt = queue.popleft()
        c_x, c_y = cur
        if g[c_x][c_y] == '#':
          continue
        if not dp[c_x][c_y] or (dp[c_x][c_y] and dp[c_x][c_y] > cnt):
            dp[c_x][c_y] = cnt

            for x, y in move:
                next = [cur[0] + x, cur[1] + y]
                if next == start:
                    continue
                if next != pre and next[0] >= 0 and next[0] < h and next[1] >= 0 and next[1] < w:
                    queue.append([next, cur, cnt + 1])
    ans= max(max([dp[i][j] for i in range(h) for j in range(w)]), ans)


print(ans)
N, M = map(int, input().split())
A = [input() for i in range(N)]
B = [input() for j in range(M)]

ans = True
for k in range(len(B)):
    if B[k] not in A[k]:
        ans = False
        break
print("Yes" if ans == True else "No")

### FIXED CODE ###

A, B = map(int, input().split())
if A == B:
    ans = 'Draw'
elif A == 1:
    ans = 'Alice'
elif B == 1:
    ans = 'Bob'
elif A > B:
    ans = 'Alice'
else:
    ans = 'Bob'
print(ans)
days = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
day = input()
i = 7 - days.indexOf(day)
print(i)

### FIXED CODE ###

days = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
day = input()
print(7 - days.index(day))
n,m = map(int,input().split())
d = dict()
for i in range(m):
    k,v = map(int,input().split())
    if k in d:
        if d[k] !=v:
            print(-1)
            exit()
    else:
        d[k] = v
if 2 not in d:
    d[2] = 0
if 3 not in d:
    d[3] = 0
res = str(d[1])+str(d[2])+str(d[3])
if res == "000":
    print(-1)
    exit()
print(res)

### FIXED CODE ###

n, m = map(int, input().split())
lst = [x for x in range(n)]
dic = {}
not_found = False
special_case = False
for i in range(m):
    a, b = map(int, input().split())
    if str(a) not in list(dic.keys()):
        dic[str(a)] = b
    else:
        if dic[str(a)] != b:
            not_found = True
    lst[a - 1] = b
if m == 0:
    special_case = True
if not_found:
    print(-1)
elif special_case:
    if n == 1:
        print(0)
    elif n == 2:
        print(10)
    else:
        print(100)
else:
    for i in range(n):
        if str(i + 1) not in list(dic.keys()):
            if i + 1 == 1:
                lst[i] = 1
            else:
                lst[i] = 0
    lst = list(map(str, lst))
    res = ''.join(lst)
    if res[0] == '0' and len(res) > 1:
        print(-1)
    else:
        print(int(res))
//#define _GLIBCXX_DEBUG
//#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,k; cin >> n >> k;
    int a[n]; for (int i = 0; i<n; i++) cin >> a[i];
    cout << (((n-k)+(k-2))/(k-1))+1 << "\n";
}

### FIXED CODE ###

import math

n,k = map(int,input().split())
a = list(map(int,input().split()))
print(math.ceil((n-k)/(k-1))+1)
input = input()
print(input**3)


### FIXED CODE ###

input = input()
print(int(input)**3)
a = input()
b = input()

def MaxCoinCount(A,B):
  ans = 0
  if A > B:
    ans = A + (A - 1)
  elif A < B:
    ans = B + (B + 1)
  else:
    ans = A + B


MaxCoinCount(a, b)

### FIXED CODE ###

A, B = map(int, input().split())

def MaxCoinCount(A,B):
  ans = 0
  if A > B:
    ans = A + (A - 1)
  elif A < B:
    ans = B + (B - 1)
  else:
    ans = A + B
  return ans


print(MaxCoinCount(A,B))
s = input()
t = input()
a = len(s)

if len(x) <=10 and len(x) >= 1 and len(t) == len(s) + 1 and t[0:a] == s[0:a]:
  print('yes')
else:
  print('no')

### FIXED CODE ###

s = input()
t = input()
a = len(s)

if len(s) <=10 and len(s) >= 1 and len(t) == len(s) + 1 and t[0:a] == s[0:a]:
  print('Yes')
else:
  print('No')
n = int(input())
// 3*5*7, 3*5*11, 3*5*13
if n < 3*5*7:
    print(0)
elif n < 3*5*11:
    print(1)
elif n < 3*5*13:
    print(2)
else:
    print(3)

### FIXED CODE ###

def fact(n):
    num = n
    cnt = [0]*(n+1)
    ans = 1
    for i in range(2, n+1):
        while num % i == 0:
            cnt[i] += 1
            num /= i
    for i in range(2, n+1):
        ans *= cnt[i] + 1
    return ans

n = int(input())

res = 0
for i in range(1, n+1):
    if i % 2 == 1 and fact(i) == 8:
        res += 1
print(res)
X,Y = map(int,input().split())
if (X + Y) % 3 != 0:
    print(0)
    exit()
n = (-X+2*Y)//3
m = (2*X-Y)//3
if n < 0 or m < 0:
    print(0)
    exit()

mod = 10**9+7
mod_inv = [0, 1] + [0] * (min(n,m)+3)
for i in range(2, min(n,m)+5):
    mod_inv[i] = - mod_inv[mod % i] * (mod // i) % mod
def comod(n, r, mod):
    ans = 1
    for i in range(r):
        ans *= (n-i) % mod
        ans *= mod_inv[i+1]
        ans %= mod
    return ans
ans = comod(n+m,n,mod)
print(ans)

### FIXED CODE ###

X,Y = map(int,input().split())
if (X + Y) % 3 != 0:
    print(0)
    exit()
n = (-X+2*Y)//3
m = (2*X-Y)//3
if n < 0 or m < 0:
    print(0)
    exit()

mod = 10**9+7
mod_inv = [0, 1] + [0] * (max(n,m)+3)
for i in range(2, max(n,m)+5):
    mod_inv[i] = - mod_inv[mod % i] * (mod // i) % mod
def comod(n, r, mod):
    ans = 1
    for i in range(r):
        ans *= (n-i) % mod
        ans *= mod_inv[i+1]
        ans %= mod
    return ans
ans = comod(n+m,n,mod)
print(ans)
a,b=input().split();print(a if a=>b else int(a)-1)

### FIXED CODE ###

a,b=input().split();print(a if b>=a else int(a)-1)
def gcd(a,b):
  if b==0:
    return a
  else:
    return gcd(b,a%b)
  
n,x=map(int,input())
arr=list(map(int,input().split()))
arr.append(x)
arr=sorted(arr)
arr2=[]
for i in range(n-1):
  arr2.append(arr[i+1]-arr[0])
if n==1:
  print(abs(arr[0]-x))
else:
  ans=gcd(arr2[0],arr2[1])
  for i in range(1,n):
    ans=gcd(ans,arr2[i])
  print(ans)

### FIXED CODE ###

def gcd(a,b):
  if b==0:
    return a
  else:
    return gcd(b,a%b)
  
n,x=map(int,input().split())
arr=list(map(int,input().split()))
arr.append(x)
arr=sorted(arr)
arr2=[]
for i in range(n):
  arr2.append(arr[i+1]-arr[0])
if n==1:
  print(arr2[0])
else:
  ans=gcd(arr2[0],arr2[1])
  for i in range(1,n):
    ans=gcd(ans,arr2[i])
  print(ans)
def solve(i, m):
  if dp[i][m] is not -1
    return dp[i][m]

  if m == 0:
    dp[i][m] = 1
  elif i >= n:
    dp[i][m] = 0
  elif solve(i+1, m):
    dp[i][m] = 1
  elif solve(i+1, m-A[i]):
    dp[i][m] = 1
  else:
    dp[i][m] = 0

  return dp[i][m]



n = input()
A = map(int, raw_input().split())
p = input()
m = map(int, raw_input().split())

for i in range(n):
  for m in range(p):
    dp[i][m] == -1

for i in range(p):
  if solve(0, m[i]):
    print 'yes'
  else:
    print 'no'

### FIXED CODE ###

def solve(i, m):
  if dp[i][m] != -1:
    return dp[i][m]

  if m == 0:
    dp[i][m] = 1
  elif i >= n:
    dp[i][m] = 0
  elif solve(i+1, m):
    dp[i][m] = 1
  elif solve(i+1, m-A[i]):
    dp[i][m] = 1
  else:
    dp[i][m] = 0

  return dp[i][m]



n = input()
A = map(int, raw_input().split())
p = input()
m = map(int, raw_input().split())

dp = [[-1 for col in range(2000)] for row in range(n+1)]

for i in range(p):
  if solve(0, m[i]):
    print 'yes'
  else:
    print 'no'