Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**7)
n,q = map(int,input().split())
tree = [[] for i in range(n)]
for i in range(n-1):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    tree[a].append(b)
    tree[b].append(a)

ans = [0 for i in range(n)]
for i in range(q):
    p,x = map(int,input().split())
    p -= 1
    ans[p] += x

#入力

def dfs(pre,now,w):
    ans[now] += w
    for i in tree[now]:
        if i != pre:
            dfs(now,i,ans[now])

dfs(-1,0,0)

print(*ans)

### FIXED CODE ###

n,q = map(int,input().split())
tree = [[] for i in range(n)]
for i in range(n-1):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    tree[a].append(b)

ans = [0 for i in range(n)]
for i in range(q):
    p,x = map(int,input().split())
    p -= 1
    ans[p] += x

#入力

stack = [0]
while len(stack) > 0:
    now = stack.pop()
    for i in tree[now]:
        ans[i] += ans[now]
        stack.append(i)

for i in range(n):
    print(ans[i],end=" ")
print()
### BUGGY CODE ###

N= int(input())

A=list(input().split())

flag=1
for i in range(N-1):
  if A.count(A[i])>1:
    flag=0
if flag==1:
  print('YES')
else:
  print('NO')




### FIXED CODE ###

N= int(input())

A=sorted(list(input().split()))
flag=1
for i in range(N-1):
  if A[i]==A[i+1]:
    flag=0
    break
if flag==1:
  print('YES')
else:
  print('NO')
### BUGGY CODE ###

n = int(input())
a = list(map(int,input().split()))

for i in range(n):
    b = a.count(i+1)
    print(b)
    del a[:b]
    


### FIXED CODE ###

n = int(input())
A = list(map(int,input().split()))

lis = [0] * n
for i in A:
  lis[i-1] += 1

for j in range(len(lis)):
  print(lis[j])
### BUGGY CODE ###

import sys
import numpy as np

stdin = sys.stdin
 
ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces

N = ri()
x = int((2 * N) ** (0.5))
if x * (x+1) == 2 * N:
    print('Yes')
else:
    print('No')
    exit()

k = x + 1 #部分集合の個数 
num = 2 * N // k #部分集合の要素数
answer = []
used = set()
unused = list(range(1, N+1))

for i in range(k):
    l = []
    for j in range(i):
        for x in answer[j]:
            if x not in used:
                l.append(x)
                used.add(x)
                break
    if len(l) < num:
        y = num - len(l)
        l.extend(unused[:y])
        unused = unused[y:]
    answer.append(l)
print(k)
for a in answer:
    print(num, *a)


### FIXED CODE ###

import sys
from itertools import combinations

stdin = sys.stdin
 
ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces

N = ri()
x = int((2 * N) ** (0.5))
if x * (x+1) == 2 * N:
    print('Yes')
else:
    print('No')
    exit()

k = x + 1 #部分集合の個数 
num = 2 * N // k #部分集合の要素数
answer = [[] for _ in range(k)]
for i, (a, b) in enumerate(combinations(range(k), 2), 1):
    answer[a].append(i)
    answer[b].append(i)

print(k)
for a in answer:
    print(num, *a)
### BUGGY CODE ###

input_lines = input().split()
N = int(input_lines[0])
M = int(input_lines[1])
S = input()
T = input()

def gcd(a, b):
  while b > 0:
    a, b = b, a%b
  return a

def lcm(a, b):
  return a*b/gcd(a, b)

L = int(lcm(N,M))
x = 1
count = 0
while True:
    k = L*x
    flag = 1
    for i in range(N):
        for j in range(M):
            hoge = i*k/N+1
            fuga = j*k/M+1
            if(hoge < fuga):
                break
            elif(hoge == fuga):
                if(S[i] != T[j]):
                    flag = 0
                    count += 1
                    break
        if(flag == 0):
            break
    if(flag == 1):
        print(k)
        break
    if(count == 2):
        print(-1)
        break
    x += 1


### FIXED CODE ###

input_lines = input().split()
N = int(input_lines[0])
M = int(input_lines[1])
S = input()
T = input()

def gcd(a, b):
  while b > 0:
    a, b = b, a%b
  return a

def lcm(a, b):
  return a*b/gcd(a, b)

L = int(lcm(N,M))
x = 1
count = 0
while True:
    k = L*x
    flag = 1
    starti = 0
    startj = 0
    for i in range(starti, N):
        for j in range(startj, M):
            hoge = i*k/N+1
            fuga = j*k/M+1
            if(hoge < fuga):
                startj = j - 1
                break
            elif(hoge == fuga):
                if(S[i] != T[j]):
                    flag = 0
                    count += 1
                    break
        if(flag == 0):
            break
    if(flag == 1):
        print(k)
        break
    if(count == 2):
        print(-1)
        break
    x += 1
### BUGGY CODE ###

import bisect
N, M = map(int, input().split())

A = sorted([int(_) for _ in input().split()])

tmp = 0
for m in range(1, M + 1):
    div = A[-m]
    tmp += div
    div = div // 2
    bisect.insort(A, div)
    #print(A)
print(sum(A) - tmp)

### FIXED CODE ###

import heapq

N, M = map(int, input().split())
A = [-int(_) for _ in input().split()]
heapq.heapify(A)

tmp = 0
for m in range(M):
    div = -heapq.heappop(A)
    div = div // 2
    heapq.heappush(A, -div)
print(-sum(A))
### BUGGY CODE ###

from operator import mul
from functools import reduce

import sys
input = sys.stdin.readline

n = input()
n_list = list(map(int, input().split()))
n_value = (reduce(mul, n_list))

if n_value > 10**18:
    n_value = -1
print(n_value)

### FIXED CODE ###

import sys
input = sys.stdin.readline

n = input()
n_list = sorted([int(i) for i in input().split()])
value = 1
for i in n_list:
    value = value * i
    if value > 10 ** 18:
        value = -1
        break
print(value)
### BUGGY CODE ###

from operator import itemgetter
import sys
def read():
    return sys.stdin.readline().rstrip()
def main():
    N, Q = map(int, read().split())
    C = list(map(int, read().split()))
    E = []

    D = {C[i]: -1 for i in range(N)}
    for i in range(N):
        D_i = D[C[i]]
        if D_i != -1:
            E.append((D_i, i, -1))
        D[C[i]] = i

    for i in range(Q):
        l, r = map(int, input().split())
        E.append((l - 1, r - 1, i))

    def f(tup):
        return tup[0]
    E.sort(key=f, reverse=True)

    # Binary Indexed Tree (Fenwick Tree)
    class BIT:
        def __init__(self, n):
            self.n = n
            self.data = [0] * (n + 1)
            self.el = [0] * (n + 1)

        def sum(self, i):
            s = 0
            while i > 0:
                s += self.data[i]
                i -= i & -i
            return s

        def add(self, i, x):
            # assert i > 0
            self.el[i] += x
            while i <= self.n:
                self.data[i] += x
                i += i & -i

        def get(self, i, j=None):
            if j is None:
                return self.el[i]
            return self.sum(j) - self.sum(i)

    ANS = [0] * Q
    d = BIT(N)
    for e in E:
        if e[2] == -1:
            d.add(e[1], 1)
        else:
            ANS[e[2]] = e[1] - e[0] + 1 - d.sum(e[1])

    for i in range(Q):
        print(ANS[i])

if __name__ == '__main__':
    main()

### FIXED CODE ###

from collections import defaultdict
import sys
def read():
    return sys.stdin.readline().rstrip()
def main():
    N, Q = map(int, read().split())
    C = list(map(int, read().split()))
    E = defaultdict(list)

    D = [-1] * (N + 1)
    for i in range(N):
        D_i = D[C[i]]
        if D_i != -1:
            E[D_i].append((D_i, i))
        D[C[i]] = i

    F = defaultdict(list)
    for i in range(Q):
        l, r = map(int, input().split())
        F[l-1].append((r - 1, i))



    # Binary Indexed Tree (Fenwick Tree)
    class BIT:
        def __init__(self, n):
            self.n = n
            self.data = [0] * (n + 1)
            self.el = [0] * (n + 1)

        def sum(self, i):
            s = 0
            while i > 0:
                s += self.data[i]
                i -= i & -i
            return s

        def add(self, i, x):
            # assert i > 0
            self.el[i] += x
            while i <= self.n:
                self.data[i] += x
                i += i & -i

        def get(self, i, j=None):
            if j is None:
                return self.el[i]
            return self.sum(j) - self.sum(i)

    ANS = [0] * Q
    d = BIT(N)
    for x in range(N - 1, -1, -1):
        for e in E[x]:
            d.add(e[1], 1)
        for f in F[x]:
            ANS[f[1]] = f[0] - x + 1 - d.sum(f[0])

    for i in range(Q):
        print(ANS[i])

if __name__ == '__main__':
    main()
### BUGGY CODE ###

MOD = 1000000007

n, m = [int(i) for i in input().split()]
a = [int(input()) for _ in range(m)]
steps = [0] * (n + 1)
steps[0] = 1

for now in range(n):
    for next_ in range(now + 1, min(now + 2, n) + 1):
        if next_ not in a:
            steps[next_] += steps[now]
            steps[next_] %= MOD
print(steps[-1])



### FIXED CODE ###

import sys
input = sys.stdin.readline

MOD = 1000000007


def main():
    n, m = [int(i) for i in input().split()]
    a = {int(input()) for _ in range(m)}
    steps = [0] * (n + 1)
    steps[0] = 1

    for now in range(n):
        for next_ in range(now + 1, min(now + 2, n) + 1):
            if next_ not in a:
                steps[next_] += steps[now] % MOD
                steps[next_] %= MOD
    print(steps[-1])


if __name__ == '__main__':
    main()
### BUGGY CODE ###

n, a, b = list(map(int, input().split()))
s = input()

# a: 国内の学生
# b: 海外の学生
# c: その他
# i番idxはi位

# # 海外の学生
# foregin_list = []
# for i, c in enumerate(s):
#     if c == "b":
#         foregin_list.append(i)


passes_num = 0
foregin_list = []
thredshould = a + b
for i, c in enumerate(s):
    if c == "c":
        print("No")
    elif c == "a":
        if passes_num < thredshould:
            passes_num += 1
            print("Yes")
        else:
            print("No")
    else:
        foregin_list.append(i)
        if passes_num < thredshould and foregin_list.index(i) + 1 <= b:
            passes_num += 1
            print("Yes")
        else:
            print("No")


### FIXED CODE ###

n, a, b = list(map(int, input().split()))
s = input()

# a: 国内の学生
# b: 海外の学生
# c: その他
# i番idxはi位


passes_num = 0  # 通過した人の数
foregin_rank = 1  # 海外の学生の中での順位
thredshould = a + b
for c in s:
    if c == "c":
        print("No")
    elif c == "a":
        if passes_num < thredshould:
            passes_num += 1
            print("Yes")
        else:
            print("No")
    else:
        if passes_num < thredshould and foregin_rank <= b:
            passes_num += 1
            foregin_rank += 1
            print("Yes")
        else:
            print("No")
### BUGGY CODE ###

import math
import time

N=int(input())

sum=0
for j in range(1,N+1):
    Y=int(N/j)
    sum+=int((Y*(Y+1)*j)/2)

print(sum)

### FIXED CODE ###

import math
import time

N=int(input())

sum=0
for j in range(1,N+1):
    Y=int(N/j)
    sum+=int((Y*(Y+1)*j)/2)

print(sum)
### BUGGY CODE ###

N = int(input())
A = [int(k) for k in input().split(' ')]

from collections import Counter 
import math 

res = []

# counter ver
A_c = Counter(A)
l = len(A_c)

def ncr(j):
  return math.factorial(j) // math.factorial(2) // math.factorial(j - 2) if j >= 2 else 0

# store ncr for each value 
combs = {k: ncr(v) for k, v in A_c.items()}

s = sum(combs.values())
  
for k in range(N): # k = k - 1
  m = A[k] # value of k
  cnt = combs[m] # number of combinations for k

  n = s
  n -= cnt # the only inaccurate entry
  n += ncr(A_c[m] - 1)
  res.append(n)

print('\n'.join([str(s) for s in res]))

### FIXED CODE ###

N = int(input())
A = [int(k) for k in input().split(' ')]

from collections import Counter 
import math 

res = [] # solution for each key in A
res_list = {} # solution for each value in A

# counter ver
A_c = Counter(A)
l = len(A_c)

def ncr(j):
  return int(j * (j-1) / 2) if j >= 2 else 0

# store ncr for each value 
combs = {k: ncr(v) for k, v in A_c.items()}

s = sum(combs.values())
  
for m in A_c.keys():
  res_list[m] = s - combs[m] + ncr(A_c[m] - 1)

for k in range(N):
  res.append(res_list[A[k]])
print('\n'.join([str(s) for s in res]))
### BUGGY CODE ###

N = int(input())

s = set()

for _ in range(N):

    A = int(input())

    if A in s:
        s = s - {A}
        continue
    
    s.add(A)

print(len(s))


### FIXED CODE ###

N = int(input())
d = {}
a = []
for _ in range(N):
    A = int(input())
    a.append(A)
    if not(A in d):
        d[A] = 1
        continue
    elif d[A]==1:
        d[A] = 0
    else:
        d[A] = 1

ans = 0
for key in d:
    if d[key]==1:
        ans = ans + 1
print(ans)
### BUGGY CODE ###

y=int(input())
b=[[i,j,k]  for i in range(1,y+1) for j in range(1,y+1) for k in range(1,y+1) ]
c=[]
for l in range(y**3):
    import math
    a = b[l]
    ans = a[0]
    ans1 = math.gcd(ans, a[1])
    ans2 =math.gcd(ans,a[2])
    ans3 =math.gcd(ans1,ans2)
    c.append(ans3)
print(sum(c))   

### FIXED CODE ###

import math
y=int(input())
cnt=0
for i in range (1,y+1):
    for k in range(1,y+1):
        for j in range(1,y+1):
            a = [i,j,k]#リスト
            ans = a[0]
            for x in range(len(a)):
                ans = math.gcd(ans, a[x])
            cnt+=ans
print(cnt)
### BUGGY CODE ###

import sys
# x,y = map(int,input().split())
n = int(input())
a = list(map(int,input().split()))
a = sorted(a)
ans = 0
M = 1000005
cnt = [0 for _ in range(M)]

for ix,x in enumerate(a):
    i = x
    while i < M:
        cnt[i] += 1
        i += x
for x in a:
    if cnt[x] == 1:
        ans += 1


print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
a = sorted(a)
ans = 0
M = 1000005
cnt = [0 for _ in range(M)]
mx = max(a)+1
for x in a:
    for j in range(x,mx,x):
        cnt[j] += 1
    
for x in a:
    if cnt[x] == 1:
        ans += 1


print(ans)
### BUGGY CODE ###

def main():
    n, m, *ab, = map(int, open(0).read().split())
    p = [-1] * (n + 1)

    def find(x):
        while p[x] > 0:
            x = p[x]
        return x

    def union(i, j):
        pi, pj = find(i), find(j)
        if pi == pj:
            return
        if p[pi] < p[pj]:
            pi, pj = pj, pi
            i, j = j, i
        p[pi] += p[pj]
        p[pj] = pi
        #reconnect(j, pi)

    def reconnect(i, j):
        while p[i] > 0:
            k = p[i]
            p[i] = j
            i = k

    for i, j in zip(ab[::2], ab[1::2]):
        union(i, j)

    print(-min(p))


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    n, m, *ab, = map(int, open(0).read().split())
    p = [-1] * (n + 1)

    def find(x):
        while p[x] > 0:
            x = p[x]
        return x

    def union(i, j):
        pi, pj = find(i), find(j)
        if pi == pj:
            return
        if p[pi] < p[pj]:
            pi, pj = pj, pi
            i, j = j, i
        p[pi] += p[pj]
        p[pj] = pi
        reconnect(j, pi)

    def reconnect(i, j):
        while p[i] > 0:
            k = p[i]
            p[i] = j
            i = k

    for i, j in zip(ab[::2], ab[1::2]):
        union(i, j)

    print(-min(p))


if __name__ == '__main__':
    main()
### BUGGY CODE ###

N, M = map(int, input().split())
drink = []
cost = 0
count = 0
d_count = 0
rest = 0


for _ in range(N):
    drink.append(list(map(int, input().split())))
    drink = sorted(drink)

for i in range(N):
    cost += drink[i][0] * drink[i][1]
    d_count += drink[i][1]
    count += 1
    if d_count > M:
      cost -= drink[i][0] * (d_count - M)
      break
      

print(cost)
    


### FIXED CODE ###

N, M = map(int, input().split())
drink = []
cost = 0
d_count = 0


for _ in range(N):
    drink.append(list(map(int, input().split())))
    
drink = sorted(drink)

for i in range(N):
    cost += drink[i][0] * drink[i][1]
    d_count += drink[i][1] 
    if d_count > M:
      cost -= drink[i][0] * (d_count - M)
      break
      

print(cost)
### BUGGY CODE ###

s=input()
K=int(input())
N=len(s)
tmp=set()

for i in range(N):
  for j in range(i,N):
    tmp.add(s[i:j+1])
    
lis=sorted(tmp)
#print(lis)
print(lis[K-1])

### FIXED CODE ###

s=input()
K=int(input())
N=len(s)
tmp=set()

for i in range(N):
  for j in range(K):
    t= s[i:i+j+1]
    #print(i,j,t)
    tmp.add(t)
    
lis=sorted(tmp)
#print(lis)
print(lis[K-1])
### BUGGY CODE ###

class UnionFind:
	def __init__(self, n):
		self.par = [i for i in range(n)]  # 親
		self.rank = [1] * n  # 深さ
		self.size = [1] * n  # size[i]はiを根とするグループのサイズ

	def find(self, x):  # xの親を返す
		if self.par[x] == x:
			return x
		else:
			return self.find(self.par[x])

	def unite(self, x, y):  # x,yの属する集合をマージする
		x = self.find(x)
		y = self.find(y)
		if x != y:
			if self.rank[x] < self.rank[y]:
				self.par[x] = y
				self.size[y] += self.size[x]
			else:
				self.par[y] = x
				self.size[x] += self.size[y]
				if self.rank[x] == self.rank[y]:
					self.rank[x] += 1

N, M = map(int, input().split())
X, Y, Z = [0] * M, [0] * M, [0] * M
for i in range(M):
	X[i], Y[i], Z[i] = map(int, input().split())

uf = UnionFind(N)

for j in range(M):
	uf.unite(X[j] - 1, Y[j] - 1)

ans = 0
root = []
for k in range(N):
	tmp = uf.find(k)
	if tmp not in root:
		ans += 1
		root.append(tmp)
print(ans)


### FIXED CODE ###

class UnionFind:
	def __init__(self, n):
		self.par = [i for i in range(n)]  # 親
		self.rank = [1] * n  # 深さ
		self.size = [1] * n  # size[i]はiを根とするグループのサイズ

	def find(self, x):  # xの親を返す
		if self.par[x] == x:
			return x
		else:
			return self.find(self.par[x])

	def unite(self, x, y):  # x,yの属する集合をマージする
		x = self.find(x)
		y = self.find(y)
		if x != y:
			if self.rank[x] < self.rank[y]:
				self.par[x] = y
				self.size[y] += self.size[x]
			else:
				self.par[y] = x
				self.size[x] += self.size[y]
				if self.rank[x] == self.rank[y]:
					self.rank[x] += 1

N, M = map(int, input().split())
X, Y, Z = [0] * M, [0] * M, [0] * M
for i in range(M):
	X[i], Y[i], Z[i] = map(int, input().split())

uf = UnionFind(N)

for j in range(M):
	uf.unite(X[j] - 1, Y[j] - 1)

roots = set([])
for k in range(N):
	roots.add(uf.find(k))
print(len(roots))
### BUGGY CODE ###

import sys
input = sys.stdin.readline
def solve():
  n = int(input())
  a = list(int(i) for i in input().split())
  one = [0]*61
  zero = [0]*61
  for number in a:
    for i in range(61):
      if number >> i &1 == 1:
        one[i] +=1
      else:
        zero[i] += 1
  ans = 0
  mod = 10**9+7
  for i in range(61):
    ans += one[i]*zero[i]*int(2**i)%mod
    ans %= mod
  print(ans)
        
solve()

### FIXED CODE ###

import sys
input = sys.stdin.readline
def solve():
  n = int(input())
  a = list(int(i) for i in input().split())
  one = [0]*62
  zero = [0]*62
  for number in a:
    for i in range(62):
      if number >> i &1 == 1:
        one[i] +=1
      else:
        zero[i] += 1
  ans = 0
  mod = 10**9+7
  for i in range(62):
    ans += one[i]*zero[i]*int(2**i)
    ans %= mod
  print(ans)
        
solve()
### BUGGY CODE ###

n=int(input())
a=list(map(int,input().split()))
import math
comb_list=[]
ind_list=[]
def comb(n,r):
    return math.factorial(n)//((math.factorial(r))*(math.factorial(n-r)))
        
for idx in range(n):
    for jdx in range(idx+1,n):
        if a[idx]>a[jdx]:
            comb_list.append(comb(a[idx],a[jdx]))
            ind_list.append([a[idx],a[jdx]])
        else:
            comb_list.append(comb(a[jdx],a[idx]))
            ind_list.append([a[jdx],a[idx]])

max_num=max(comb_list)
for i in range(len(comb_list)):
    if comb_list[i]==max_num:
        ans=ind_list[i]
        
print(ans[0],ans[1])

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
a=sorted(a,reverse=True)
comb_n=a[0]
a=a[1:]
r_ind=int(comb_n/2)

ans=0
for i in range(len(a)-1):
     if abs(a[i]-r_ind)<=abs(a[i+1]-r_ind):
          ans=a[i]
          break
print(comb_n,ans)
### BUGGY CODE ###

class KMP:
    pattern = None
    length = -1
    failed = None
    def __init__(self, pattern):
        self.pattern = pattern
        self.length = len(pattern)
        self.failed = [-1 for i in xrange(self.length)]
        prev = -1
        for i in xrange(1, self.length):
            while prev!=-1 and pattern[prev+1]!=pattern[i]:
                prev = self.failed[i-1]
            if pattern[prev+1]==pattern[i]:
                prev += 1
            self.failed[i] = prev

def minimumLen(s, t):
    kmp = KMP(t)
    offset = -1
    for c in s:
        while offset!=-1 and kmp.pattern[offset+1]!=c:
            offset = kmp.failed[offset]
        if kmp.pattern[offset+1]==c:
            offset += 1
    return len(s)+len(t)-(offset+1)

def main():
    n = int(raw_input().strip())
    s = raw_input().strip()
    t = raw_input().strip()
    print minimumLen(s, t)

if __name__ == '__main__':
    main()

### FIXED CODE ###

class KMP:
    pattern = None
    length = -1
    failed = None
    def __init__(self, pattern):
        self.pattern = pattern
        self.length = len(pattern)
        self.failed = [-1 for i in xrange(self.length)]
        for i in xrange(1, self.length):
            prev = self.failed[i-1]
            while prev!=-1 and pattern[prev+1]!=pattern[i]:
                prev = self.failed[prev]
            if pattern[prev+1]==pattern[i]:
                prev += 1
            self.failed[i] = prev

def minimumLen(s, t):
    kmp = KMP(t)
    offset = -1
    for c in s:
        while offset!=-1 and kmp.pattern[offset+1]!=c:
            offset = kmp.failed[offset]
        if kmp.pattern[offset+1]==c:
            offset += 1
    return len(s)+len(t)-(offset+1)

def main():
    n = int(raw_input().strip())
    s = raw_input().strip()
    t = raw_input().strip()
    print minimumLen(s, t)

if __name__ == '__main__':
    main()
### BUGGY CODE ###

# -*- coding: utf-8 -*-

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

A = []
for _ in range(Q):
    A.append(int(input()))

part = []
for _ in range(N):
    part.append(K)

for ans in A:
    for i in range(N):
        part[i] -= 1

    part[ans - 1] += 1

for x in part:
    if x <= 0:
        print('No')
    else:
        print('Yes')


### FIXED CODE ###

# -*- coding: utf-8 -*-

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

part = [K - Q for _ in range(N)]

for _ in range(Q):
    part[int(input()) - 1] += 1

for x in part:
    if x <= 0:
        print('No')
    else:
        print('Yes')
### BUGGY CODE ###

K = int(input())

total = 0
# 3つ同じ
for i in range(K):
  total += i+1

# 2つ同じ
#for i in range(0,K-1):
#  total += 6*(K-1-i)*(i+1)

total += 6*(K-1)	# １つが必ず1の場合

for i in range(1,K-1):
  for j in range(i+1,K):
    tmp = 0
    for k in range(1,i+2):
      if (i+1)%k == 0 and (j+1)%k == 0:
        tmp = k
    total += tmp*6

# バラバラ
total += int(6*(K-1)*(K-2)/2)	# １つが必ず1の場合
for i in range(1,K-2):
  for j in range(i+1,K-1):
    for k in range(j+1,K):
      if (j+1)%(i+1) == 0 and (k+1)%(i+1) == 0:
        total += (i+1)*6
      else:
        tmp = 0
        for l in range(1,i+1):
          if (i+1)%l == 0 and (j+1)%l == 0 and (k+1)%l == 0:
            tmp = l
        total += tmp*6
print(total)
  


### FIXED CODE ###

K = int(input())

total = 0
for i in range(1,K+1,1):
  for j in range(1,K+1,1):
    tmp1 = i
    tmp2 = j
    while tmp1 % tmp2 != 0:
      tmp = tmp1 % tmp2
      tmp1 = tmp2
      tmp2 = tmp
    for k in range(1,K+1,1):
      tmp1 = k
      tmp3 = tmp2
      while tmp1 % tmp3 != 0:
        tmp = tmp1 % tmp3
        tmp1 = tmp3
        tmp3 = tmp
      total += tmp3
print(total)
### BUGGY CODE ###

from math import floor

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

max_v = 0
if n < b:
  max_v = floor(a * n / b)
else:
  for i in range(b - 1, n + 1, b):
    t = floor(a * i / b) - a * floor(i / b)
    if t > max_v:
      max_v = t
print(max_v)

### FIXED CODE ###

from math import floor

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

max_v = 0
if n < b:
  max_v = floor(a * n / b)
else:
  if b != 1:
    for i in range(b - 1, n + 1, b):
      j = 0
      t = floor(a * i / b) - a * j
      if t > max_v:
        max_v = t
      j += 1
print(max_v)