Harryxun/stf_run huggingface dataset:
import sys
sys.setrecursionlimit(100001)

n, k = list(map(int,input().split(' ')))
path = []
for i in range(n+1):
    path.append([])
for i in range(n-1):
    a, b = list(map(int,input().split(' ')))
    path[a].append(b)
val = [0] * (n+1)
for i in range(k):
    v, pt = list(map(int,input().split(' ')))
    val[v] += pt
# DFS
def f(current):
    for next_v in path[current]:
        val[next_v] += val[current]
        if path[next_v]:
            f(next_v)

f(1)

print(' '.join([str(pt) for pt in val[1:]]))


### FIXED CODE ###

from collections import deque

n, k = list(map(int,input().split(' ')))
path = []
for i in range(n+1):
    path.append([])
for i in range(n-1):
    a, b = list(map(int,input().split(' ')))
    path[a].append(b)
    path[b].append(a)
val = [0] * (n+1)
for i in range(k):
    v, pt = list(map(int,input().split(' ')))
    val[v] += pt

used = {}
q = deque([1])
used[1] = True
while q:
    v = q.pop()
    for next_v in path[v]:
        if next_v not in used:
            used[next_v] = True
            val[next_v] += val[v]
            q.append(next_v)

print(' '.join([str(pt) for pt in val[1:]]))
a

### FIXED CODE ###

import math
n = int(input())

print(math.ceil(n/2))
import sys
sys.setrecursionlimit(100000)

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

dic_score={}
tree_list=[]
for i in range(N+1):
  tree_list.append([])
ans_list=[0]*(N+1)

def dfs(v,s):
  global dic_score
  global tree_list
  global ans_list
  
  score=s
  if v in dic_score:
    score+=dic_score[v]
    
  ans_list[v]+=score
  for vv in tree_list[v]:
    dfs(vv,score)
    
  return s

for i in range(N-1):
  a,b=map(int,input().split())
  tree_list[a].append(b)
  
for i in range(Q):
  p,x=map(int,input().split())
  if p in dic_score:
    dic_score[p]+=x
  else:
    dic_score[p]=x

dfs(1,0)

#print(tree_list)
#print(ans_list)
ans_list_str=[]
for i in range(1,N+1):
  ans_list_str.append(str(ans_list[i]))

print(" ".join(ans_list_str))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)
input=sys.stdin.readline

def dfs(u,par):
  ans_list[u]+=ans_list[par]  
  for v in tree_list[u]:
    if v!=par:
      dfs(v,u)      
  return

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

tree_list=[[] for _ in range(N+1)]
for i in range(N-1):
  a,b=map(int,input().split())
  tree_list[a].append(b)
  tree_list[b].append(a)
#print(tree_list)

ans_list=[0]*(N+1)
for i in range(Q):
  p,x=map(int,input().split())
  ans_list[p]+=x

dfs(1,0)

print(*ans_list[1:])
X, Y = map(int, input().split())
ans = 'No'
for a in range(X + 1):
    b = X - a
    if 2 * a + 4 * b == Y:
    ans = 'Yes'
print(ans)

### FIXED CODE ###

X, Y = map(int, input().split())
ans = 'No'
for a in range(X + 1):
    b = X - a
    if 2 * a + 4 * b == Y:
        ans = 'Yes'
print(ans)
N = int(input())
A = list(map(int, input().split()))
B = sorted(A)
for i in range (N):
    if B[i] != A[i]:
        k += 1
if k >= 3:
    print("NO")
else:
    print("YES")

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
B = sorted(A)
k = 0
for i in range (N):
    if B[i] != A[i]:
        k += 1
if k >= 3:
    print("NO")
else:
    print("YES")
A=input()
for i in range(3):
  if A[i]=='1':
    A[i]='9'
  else if A[i]=='9':
    A[i]='1'
print('A')

### FIXED CODE ###

n = input()
for c in n:
    if (c == '1'):
        print('9', end='')
    elif (c == '9'):
        print('1', end='')
    else:
        print(c, end='')
print()
R, G, B, N = map(int, input().split())

ans = [0]*(N//R + 1)*(N//G + 1)*(N//B + 1)
for r in range(N//R + 1):
    for g in range(N//G + 1):
        for b in range(N//B + 1):
            n = r*R + g*G + b*B
            ans[n] += 1
print(ans[n])

### FIXED CODE ###

R, G, B, N = map(int, input().split())

ans = 0
for r in range(N//R + 1):
    for g in range((N - r*R)//G + 1):
        if (N - r*R - g*G)%B == 0:
                ans += 1
print(ans)
#!/usr/bin/env python3
import sys, math, fractions, itertools

def solve(N: int, A: int, x: "List[int]"):
    X = max(x)
    dp = [[[0 for _ in range(N*X+1)] for _ in range(N+1) ] for _ in range(N+1)]
    dp[0][0][0] = 1
    for n in range(N+1):
        for m in range(N+1):
            for k in range(N*X+1):
                if n >= 1 and k < x[n-1]:
                    dp[n][m][k] = dp[n-1][m][k]
                elif n >= 1 and m >= 1 and k >= x[n-1]:
                    dp[n][m][k] = dp[n-1][m][k] + dp[n-1][m-1][k-x[n-1]]
    s = 0
    for i in range(1, N+1):
        s += dp[N][i][i*A]
    print(s)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    x = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, A, x)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys, math, fractions, itertools

def solve(N: int, A: int, x: "List[int]"):
    X = max(x)
    dp = [[[0 for _ in range(max(N*X+1, N*A+1))] for _ in range(N+1) ] for _ in range(N+1)]
    dp[0][0][0] = 1
    for n in range(N+1):
        for m in range(N+1):
            for k in range(N*X+1):
                if n >= 1 and k < x[n-1]:
                    dp[n][m][k] = dp[n-1][m][k]
                elif n >= 1 and m >= 1 and k >= x[n-1]:
                    dp[n][m][k] = dp[n-1][m][k] + dp[n-1][m-1][k-x[n-1]]
    s = 0
    for i in range(1, N+1):
        s += dp[N][i][i*A]
    print(s)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    x = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, A, x)

if __name__ == '__main__':
    main()
k = int(input())
print((n//2)*(k-n//2))

### FIXED CODE ###

k = int(input())
print((k//2)*(k-k//2))
T, X = map(int, input().split()))
print(T/X)

### FIXED CODE ###

T, X = map(int, input().split())
print(T/X)
n,m=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
sx=0
sy=0
for i in range(n):
    sx+=i*x[i]-(n-i-1)*x[i]
for i in range(n):
    sy+=i*y[i]-(n-i-1)*y[i]
print(sx*sy)

### FIXED CODE ###

#058-D
n,m=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
sx=0
sy=0
for i in range(n):
    sx+=i*x[i]-(n-i-1)*x[i]
for i in range(m):
    sy+=i*y[i]-(m-i-1)*y[i]
sx=sx%(10**9+7)
sy=sy%(10**9+7)
ans=sx*sy%(10**9+7)
print(ans)
from collections import Counter
from itertools import combinations

N = int(input())
L = Counter(list(map(int, input().split())))
ans = 0
for sides in combinations(L.keys(), 3):
    a, b, c = sides.sorted()
    if a + b > c:
        ans += L[a]*L[b]*L[c]
print(ans)

### FIXED CODE ###

from itertools import combinations

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

def f(a, b, c):
    return len(set([a, b, c])) == 3 and a+b>c and b+c>a and c+a>b

ans = 0
for a, b, c in combinations(L, 3):
    if f(a, b, c):
        ans += 1
print(ans)
x,n=map(int,input().split())
try:
    p=list(map(int,input().split()))
    p.sort()
    min=abs(p[n-1])
    for i in range(p[0],p[n-1]):
        if i not in p:
            if min>abs(i-x):
                min=abs(i-x)
                ans=i
except:
    ans=x
print(ans)

### FIXED CODE ###

x, n = map(int, input().split())
a = [int(x) for x in input().split()]
b = [i for i in range(0,102) if i not in a] 
b_tmp = list(map(lambda s:abs(s-x), b)) 
address = b_tmp.index(min(b_tmp))
print(b[address])
X = int(input())
Y = int(input())

x = int(X + Y/2)

print(x)

### FIXED CODE ###

X,Y = map(int,input().split())
print(X+Y//2)
K = int(input())
A, B = map(int, input().split())

if A//K == A//K:
  if A % K == 0:
    print("OK")
    else:
      print("NG")
      
  else:
    print("OK")


### FIXED CODE ###

K = int(input())
A, B = map(int,input().split())
 
 
if A // K == B // K:
    if A % K ==0:
        print('OK')
    else:
        print('NG')  
else:
    print('OK')
a,b,c,d=map(int,input().split());print(min(a,b)+min(c,d))

### FIXED CODE ###

a=[int(input()) for i in range(2)];b=[int(input()) for i in range(2)]
print(min(a)+min(b))
import math
N,L = input().split()
N,L = int(N),int(L)
c = math.gcd(N,L)

if(L>=0):
    print(int(0.5*N*(N+1)+N*L-N-(L)))
else:
    n = min([-L,N-1])
    print(int(0.5*N*(N+1)+N*L-N-(L+n)))

### FIXED CODE ###

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


if(L>=0):
    print(int(0.5*N*(N+1)+N*L-N-(L)))
else:
    n = min([-L,N-1])
    print(int(0.5*N*(N+1)+N*L-N-(L+n)))
input()
ps = map(int, input().split())

def count(ps):
    if len(ps) <= 2:
        return 0
    qs = sorted(ps[0:3])
    res = 1 if qs[1] == ps[1] else 0
    return res + count(ps[1:])

print(count(ps))


### FIXED CODE ###

input()
ps = list(map(int, input().split()))

def count(ps):
    if len(ps) <= 2:
        return 0
    qs = sorted(ps[0:3])
    res = 1 if qs[1] == ps[1] else 0
    return res + count(ps[1:])

print(count(ps))
a=list(input())
b=list(input())
c=list(input())
turn="a"
while True:
  if turn=="a":
    turn=a.pop()
    if not a:
      print("A")
      break
  elif turn=="b"
    turn=b.pop()
    if not b:
      print("B")
      break
  else:
    turn=c.pop()
    if not c:
      print("C")
      break

### FIXED CODE ###

S={c:list(input()) for c in "abc"}
s="a"
while S[s]:s=S[s].pop(0)
print(s.upper())
n, h = [int(z) for z in input().split()]
li2 = [int(z) for z in input().split()]

f = 0
for i in li2:
  if i >= h:
    f += 1
print(f)

### FIXED CODE ###

N = int(input())

odd = 0
even = 0
for i in range(N):
	if i % 2 == 0:
		odd += 1
	else:
		even += 1

print(odd/(odd + even))
n,m=map(int,input().split())
A=[int(i) for i in input().split()]
A.sort()
D=dict()
for i in range(m):
  b,c=map(int,input().split())
  D[c]=b
D=sorted(D.items(),key=lambda x:x[0],reverse=True)
DD=[0]*n
ct=0
for x,y in D:
  for i in range(y):
    DD[i+ct]+=x
  ct+=y
ans=0
for i in range(n):
  ans+=max(A[i],DD[i])
print(ans)


### FIXED CODE ###

from collections import defaultdict
from collections import Counter
n,m=map(int,input().split())
A=[int(i) for i in input().split()]
AA=dict(Counter(A))
D=defaultdict(int)
for i in range(m):
  b,c=map(int,input().split())
  D[c]+=b
for x in AA.keys():
  D[x]+=AA[x]
D=sorted(D.items(),key=lambda x:x[0],reverse=True)
ans,tot=0,0
for x,y in D:
  if tot+y<=n:
    ans+=x*y
    tot+=y
  else:
    ans+=x*(n-tot)
    tot+=n-tot
  if tot==n:
    break
print(ans)
N, K = map(int,input().split())
A = list(map(int,input().split()))
F = list(map(int,input().split()))
X = []
A = sorted(A)
F = sorted(F)[::-1]
for i in range(N):
  X.append([A[i] * F[i],A[i],F[i]])

import heapq
from heapq import heapify

heapq._heapify_max(X)

def _heappush_max(heap, item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap)-1)
def _heappop_max(heap):
    lastelt = heap.pop()
    if heap:
        returnitem = heap[0]
        heap[0] = lastelt
        heapq._siftup_max(heap, 0)
        return returnitem
    return lastelt
  
for i in range(K):
    x = _heappop_max(X)
    if x[0] < 1:
        _heappush_max(X,x)
        break
    else:       
        x[1] -= 1
        x[0] = x[1] * x[2]
        _heappush_max(X,x)
from operator import itemgetter
X.sort(key=itemgetter(0))
print(X[-1][0])



### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

N,K = map(int,readline().split())
A = np.array(readline().split(),np.int64)
F = np.array(readline().split(),np.int64)

A.sort(); F.sort(); F=F[::-1]

def test(x):
    return np.maximum(0,A-x//F).sum() <= K

left = -1
right = 10**13
while left+1 < right:
    mid = (left+right)//2
    if test(mid):
        right = mid
    else:
        left = mid
answer = right
print(answer)
n=int(input())
xy=[]
for i in range(n):
    a=[int(j) for j in input().split()]
    xy.append(a)

l=[]
ans=0
import itertools
for a,b in itertools.combinations(xy,2):
    p=abs(a[0]-b[0])
    q=abs(a[1]-b[1])
    l.append((p,q))

import collections
c=collections.Counter(l)
ans=c.most_common()

if n-ans[0][1]==0:
    print(1)
else:
    print(n-ans[0][1])

### FIXED CODE ###

n=int(input())
xy=[]
for i in range(n):
    a=[int(j) for j in input().split()]
    xy.append(a)

if n==1:
    print(1)
    import sys
    sys.exit()
l=[]
ans=0
import itertools
for a,b in itertools.combinations(xy,2):
    p=(a[0]-b[0])
    q=(a[1]-b[1])
    if p!=0 or q!=0:
        l.append((p,q))
        l.append((-p,-q))

import collections
c=collections.Counter(l)
p=c.most_common()

for i in p:
   ans=max(ans,i[1])
print(n-ans)
import math
import sys
sys.setrecursionlimit(10000000)

n = int(input())
s = int(input())

up = math.sqrt(n)

def colsum(num, base):
    if num < base:
        return num
    else:
        return num%base + colsum(num//base,base)

#s >= n
if s == n:
    print(n+1)
    exit()
elif s > n:
    print(-1)
    exit()


#sqrt(n)まで探索
for i in range(2,int(up)+1):
    if s == colsum(n,i):
        print(i)
        exit()

#2桁しかあり得ない場合(sqrt(n)<b<n)
for j in range(1,int(up)+1)[::-1]:
    if (n-s)%j == 0:
        b = (n-s)/j + 1
        if s == colsum(n,b) and b > 1:
            print(i)
            exit()

print(-1)

### FIXED CODE ###

import math
import sys

n = int(input())
s = int(input())

up = math.sqrt(n)

def colsum(num, base):
    if num < base:
        return num
    else:
        return num%base + colsum(num//base,base)

#s >= n
if s == n:
    print(n+1)
elif s > n:
    print(-1)
else:
    #sqrt(n)まで探索
    for i in range(2,int(up)+1):
        if colsum(n,i) == s:
            print(i)
            sys.exit()

    #2桁しかあり得ない場合(sqrt(n)<b<n)
    for j in range(int(up),0,-1):
        if (n-s)%j == 0:
            b = (n-s)/j + 1
            if colsum(n,b) == s and b > 1:
                print(int(b))
                sys.exit()

    print(-1)
def func(n):
    if n>=3:
        return (func(n-1)%(10**9+7)+func(n-2)%(10**9+7))%(10**9+7)
    elif n==2:
        return 2
    else:
        return 1

N, M = map(int, input().split())
if M:
    a=[]
    for _ in range(M):
        a.append(int(input()))



    a=[-1]+a+[N+1]
    answer=1
    for i in range(M+1):
        if a[i+1]-a[i]==1:
            print(0)
            break
        answer=( func(a[i+1]-a[i]-2)*answer )%(10**9+7)
    else:
        print(answer)

else:
    print(func(N))


### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)

N, M = map(int, input().split())
a=[]
for _ in range(M):
    a.append(int(input()))

lst=[None]*(N+1)
def func(n):
    #if n in a:
    #    return 0
    if n<=1:
        return 1
    else:
        if lst[n]:
            return lst[n]
        else:
            temp=(func(n-1)+func(n-2))%(10**9+7)
            lst[n]=temp
            return temp



a=[-1]+a+[N+1]
answer=1
for i in range(M+1):
    if a[i+1]-a[i]==1:
        print(0)
        break
    answer=( func(a[i+1]-a[i]-2)*answer )%(10**9+7)
else:
    print(answer)
N, A, B, C, D = map(int, input().split())
S = input()

c1 = [0] * len(S)
c2 = [0] * len(S)
cnt1 = 0
cnt2 = 0
for i in range(len(S)):
    if '.' == S[i]:
        c2[i] = cnt2
        cnt2 = 0
        cnt1 += 1
    else:
        c1[i] = cnt1
        cnt1 = 0
        cnt2 += 1

c1[-1] = cnt1
c2[-1] = cnt2

index2 = []
index1 = []
for i in range(N):
    if c2[i] >= 2:
        index2.append(i)
    if c1[i] >= 3:
        index1.append(i)

flag = True
for i in index2:
    if A < i - c2[i] + 1 < C or B < i - c2[i] + 1 < D:
        flag = False

if C > D and flag:
    flag = False
    for i in index1:
        if B < i < D:
            if D == i - cnt1[i] + 1:
                flag = False
                break
            flag = True

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

### FIXED CODE ###

N, A, B, C, D = map(int, input().split())
S = input()

flag = True
if "##" in S[A:max(C, D)]:
    flag = False
if C > D:
    if "..." not in S[B-2:D+1]:
        flag = False

if flag:
    print('Yes')
else:
    print('No')
a = input()
b = input()

c = a * b

if c % 2 = 0:
	print('even')
else:
	print('odd')


### FIXED CODE ###

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

if a * b % 2 == 0:
    print('Even')
else:
    print('Odd')
n = input();

if n==1:
	print('Hello World')
else:
	a = input()
	b = input()
	print(a + b)

### FIXED CODE ###

n = int(input())

if n==1:
	print('Hello World')
else:
	a = int(input())
	b = int(input())
	print(a + b)
import collections

n,m,k = map(int,raw_input().split(' '))

friendships = [map(int, raw_input().split(' ')) for _ in range(m)]
disses = [map(int, raw_input().split(' ')) for _ in range(k)]

parent = {i:i for i in range(0, n+1)}
sizes = {i:1 for i in range(0, n+1)}

hd = collections.Counter()

adj = collections.defaultdict(set)

def f(parent, a):
	if parent[a] != a: parent[a] = f(parent, parent[a])
	return parent[a]

for a,b in friendships:
	if a != b:
		pa,pb = f(parent, a), f(parent, b)
		
		adj[a].add(b)
		adj[b].add(a)

		if pa != pb:
			parent[pb] = pa
			sizes[pa] += sizes[pb]

for c,d in disses:
	pa,pb = f(parent, c), f(parent, d)
	if (pa == pb):
		hd[c] += 1
		hd[d] += 1
"""
hd[u] = k
u has k disses in its connected component
"""

print ' '.join([str(sizes[f(parent,u)] - len(adj[u]) - hd[u] - 1)  for u in range(1, n+1)])

### FIXED CODE ###

import collections

n,m,k = map(int,raw_input().split(' '))

friendships = [map(int, raw_input().split(' ')) for _ in range(m)]
disses = [map(int, raw_input().split(' ')) for _ in range(k)]

parent = {i:i for i in range(0, n+1)}
sizes = {i:1 for i in range(0, n+1)}

hd = collections.Counter()

adj = collections.defaultdict(set)

def f(parent, u):
	if parent[u] != u: 
		parent[u] = f(parent, parent[u])
	return parent[u]

for a,b in friendships:
	if a == b: continue

	pa,pb = f(parent, a), f(parent, b)
	
	adj[a].add(b)
	adj[b].add(a)

	if pa != pb:
		if sizes[pa] >= sizes[pb]:
			parent[pb] = pa
			sizes[pa] += sizes[pb]
		else:
			parent[pa] = pb
			sizes[pb] += sizes[pa]

for c,d in disses:
	pc,pd = f(parent, c), f(parent, d)
	if (pc == pd):
		hd[c] += 1
		hd[d] += 1
"""
hd[u] = k
u has k disses in its connected component
"""

print ' '.join([str(sizes[f(parent,u)] - len(adj[u]) - hd[u] - 1)  for u in range(1, n+1)])
W,H,N=map(int,input().split())
x=[]
y=[]
a=[]
w=[i for i in range(W+1)]
h=[i for i in range(H+1)]
S=W*H

for _ in range(N):
    X, Y, A = map(int, input().split())
    x.append(X)
    y.append(Y)
    a.append(A)

for i in range(len(x)):
    if a[i]==1:
        for j in range(x[i]):
            if j in w: w.remove(j)
    if a[i]==2:
        for j in reversed(range(x[i]+1,w[-1]+1)):
            if j in w: w.remove(j)
    if a[i]==3:
        for j in range(y[i]):
            if j in h: h.remove(j)
    if a[i]==4:
        for j in reversed(range(y[i]+1,h[-1]+1)):
            if j in h: h.remove(j)

if len(w)==0 or len(h)==0:
    print(0)
else:
    S_f = (w[-1]-w[0]) * (h[-1]-h[0])
    print(S_f)


### FIXED CODE ###

W,H,N=map(int,input().split())
x=[]
y=[]
a=[]
w=[i for i in range(W+1)]
h=[i for i in range(H+1)]
S=W*H

for _ in range(N):
    X, Y, A = map(int, input().split())
    x.append(X)
    y.append(Y)
    a.append(A)

for i in range(len(x)):
    if a[i]==1 and len(w)!=0:
        for j in range(x[i]):
            if j in w: w.remove(j)
    if a[i]==2 and len(w)!=0:
        for j in reversed(range(x[i]+1,w[-1]+1)):
            if j in w: w.remove(j)
    if a[i]==3 and len(h)!=0:
        for j in range(y[i]):
            if j in h: h.remove(j)
    if a[i]==4 and len(h)!=0:
        for j in reversed(range(y[i]+1,h[-1]+1)):
            if j in h: h.remove(j)
if len(w)==0 or len(h)==0:
    print(0)
else:
    S_f = (w[-1]-w[0]) * (h[-1]-h[0])
    print(S_f)
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

h, w, k= map(int, input().split())


if k%h==0 or k%w==0:
    print('Yes')
    exit()

if w!=2:
    for i in range(1,w):
        if (k-i*h) % (w-i*2) == 0 and 0<(k-i*h) // (w-i*2)<=h:
            print('Yes')
            exit()

if h!=2:
    for i in range(1,h):
        if (k-i*w) % (h-i*2) == 0 and 0<(k-i*w) // (h-i*2)<=h:
            print('Yes')
            exit()

print('No')


### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

h, w, k= map(int, input().split())

if k%h==0 or k%w==0:
    print('Yes')
    exit()

for i in range(1,w):
    if w-i*2 != 0:
        if (k-i*h) % (w-i*2) == 0 and 0<(k-i*h) // (w-i*2)<=h:
            print('Yes')
            exit()

for i in range(1,h):
    if h-i*2 != 0:
        if (k-i*w) % (h-i*2) == 0 and 0<(k-i*w) // (h-i*2)<=w:
            print('Yes')
            exit()

print('No')
import collections
from itertools import combinations
N = int(input())


def is_prime(n):
    if n == 1:
        return False
    for i in range(2, int(n**0.5)+1):
        if n % i == 0:
            return False
    return True


num = [i for i in range(2, 55556)]
num = collections.deque(num)
dp = [set() for i in range(N)]
dp[0] = {num.popleft()}
for i in range(1, N):
    if i < 5:
        tmp = num.popleft()
        while(is_prime(tmp) != True):
            tmp = num.popleft()
        dp[i] = dp[i-1] | {tmp}
    else:
        flag = False

        while(flag != True):
            tmp = num.popleft()
            while(is_prime(tmp) != True):
                tmp = num.popleft()
            for x in combinations(dp[i-1], 4):
                if is_prime(sum(x) + tmp):
                    flag = False
                    break
                else:
                    flag = True
        if flag:
            dp[i] = dp[i-1] | {tmp}

print(" ".join(map(str, dp[N-1])))


### FIXED CODE ###

def primes(n):
    ass = []
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    for i in range(len(is_prime)):
        if is_prime[i]:
            ass.append(i)
    return ass
def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True

from itertools import combinations
N=int(input())

prime_list=primes(55555)
id=4
ans=[prime_list[i] for i in range(len(prime_list)) if prime_list[i]%5==2]

print(" ".join(map(str,ans[:N])))