Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = []

geta = 0
for i in range(n):
    a = int(input())
    if a % 10 == 0:
        geta += a
    else:
        s.append(a)

s.sort(reverse=True)

tmp = sum(s)

ruiseki = [tmp]
for i in range(n-1):
    ruiseki.append(ruiseki[-1] - s[i])

ans = 0
def DFS(depth, now):
    global ans
    if depth == n:
        if now%10 != 0:
            ans = max(ans, now)
        return

    if now + ruiseki[depth] <= ans:
        return
    DFS(depth+1, now+s[depth])
    DFS(depth+1, now)
DFS(0,0)
if ans != 0:
    ans += geta
print(ans)

Fixed submission:
n = int(input())
s = []

geta = 0
for i in range(n):
    a = int(input())
    if a % 10 == 0:
        geta += a
    else:
        s.append(a)

n = len(s)
s.sort(reverse=True)

tmp = sum(s)

ruiseki = [tmp]
for i in range(n-1):
    ruiseki.append(ruiseki[-1] - s[i])

ans = 0
def DFS(depth, now):
    global ans

    if depth == n:
        if now%10 != 0:
            ans = max(ans, now)
        return
    if now + ruiseki[depth] <= ans:
        return
    DFS(depth+1, now+s[depth])
    DFS(depth+1, now)
DFS(0,0)
if ans != 0:
    ans += geta
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
for i in range(n):
    s.append(int(input()))

s.sort(reverse=True)

tmp = sum(s)

ruiseki = [tmp]
for i in range(n-1):
    ruiseki.append(ruiseki[-1] - s[i])

ans = 0
def DFS(depth, now):
    global ans

    if depth == n:
        if now%10 != 0:
            ans = max(ans, now)
        return
      
    if now + ruiseki[depth] <= ans:
        return

    DFS(depth+1, now+s[depth])
    DFS(depth+1, now)
DFS(0,0)
print(ans)

Fixed submission:
n = int(input())
s = []

geta = 0
for i in range(n):
    a = int(input())
    if a % 10 == 0:
        geta += a
    else:
        s.append(a)

n = len(s)
s.sort(reverse=True)

tmp = sum(s)

ruiseki = [tmp]
for i in range(n-1):
    ruiseki.append(ruiseki[-1] - s[i])

ans = 0
def DFS(depth, now):
    global ans

    if depth == n:
        if now%10 != 0:
            ans = max(ans, now)
        return
    if now + ruiseki[depth] <= ans:
        return
    DFS(depth+1, now+s[depth])
    DFS(depth+1, now)
DFS(0,0)
if ans != 0:
    ans += geta
print(ans)
Buggy python submission (verdict: Runtime Error):
A, B, C = list(map(int, input.split()))

s = 1
if A < B:
    s = B//A + 1
syo = A*s % B   # 2とか
def ans(syo, B, C):
    for i in range(100):
        if syo * i % B == C:
            return "YES"
    return "NO"
print(ans(syo, B, C))

Fixed submission:
A, B, C = list(map(int, input().split()))

s = 1
if A < B:
    s = B//A + 1
syo = A*s % B   # 2とか
if s != 1:
    syo2 = A*(s - 1) % B - B
    syo += syo2
if syo == 0 and C == 0:
    print("YES")
elif syo == 0:
    print("NO")
else:
    flag = 0
    for i in range(1,97*93):
        if syo*i % B == C:
            print("YES")
            flag = 1
            break
    if flag == 0:
        print("NO")
Buggy python submission (verdict: Runtime Error):
N, T = list(map(int, input().split()))
t =  [int(input()) for i in range(N)]
ans = N*T
for i in t:
    if i < T:
        ans -= T - i
print(ans)


Fixed submission:
N, T = list(map(int, input().split()))
t =  list(map(int, input().split()))
ans = N*T
t.pop(0)   # startが0なの忘れてた
for i in range(len(t)):
    if i == len(t) - 1:
        break
    t[len(t) - 1- i] -= t[len(t) - 2 - i]
for i in t:
    if i < T:
        ans -= T - i
print(ans)
Buggy python submission (verdict: Runtime Error):
W, a, b = map(int, input().split())
return min(abs(a - b), abs(a - b + W), abs(b - a + W))

Fixed submission:
W, a, b = map(int, input().split())
if abs(a-b) > W:
    print(min(abs(a - b), abs(a - b + W), abs(b - a + W)))
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
    N = int(input())
    ans = 1
    for i in range(N):
        ans = ans * (i + 1) % (10**9 + 7)
    print(ans)

Fixed submission:
N = int(input())
ans = 1
for i in range(N):
    ans = ans * (i + 1) % (10**9 + 7)
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
ans = 1
for i in range(N)
    ans = ans * (i + 1) % (10**9 + 7)
print(ans)

Fixed submission:
N = int(input())
ans = 1
for i in range(N):
    ans = ans * (i + 1) % (10**9 + 7)
print(ans)
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
x = list(map(int, input().split()))
edges = [[b]*n for i in range(n)]
for i in range(n):
    edges[i][i] = 0
for i in range(n-1):
    edges[i][i+1] = edges[i+1][i] = min(b, (x[i+1]-x[i])*a)

import numpy as np
from scipy.sparse.csgraph import minimum_spanning_tree
ans = np.sum(minimum_spanning_tree(edges))
print(int(ans))

Fixed submission:
n, a, b = map(int, input().split())
x = list(map(int, input().split()))
uf = [1]*n
ans = 0
for i in range(n-1):
    if a*(x[i+1]-x[i]) <= b:
        ans += a*(x[i+1]-x[i])
        uf[i+1] = 0
ans += b*(sum(uf)-1)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = 0
cnt = 1
while True:
    s += cnt
    if s < n <= s+cnt+1:
        use = cnt+1
        sub = use*(use+1)//2 - n
        for i in range(use):
            if i+1 == sub:
                continue
            print(i+1)
        exit()
    else:
        cnt += 1


Fixed submission:
n = int(input())
if n == 1:
    print(1)
    exit()
s = 0
cnt = 1
while True:
    s += cnt
    if s < n <= s+cnt+1:
        use = cnt+1
        sub = use*(use+1)//2 - n
        for i in range(use):
            if i+1 == sub:
                continue
            print(i+1)
        exit()
    else:
        cnt += 1
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n, x = map(int, input().split())
DP = np.zeros((n,n), dtype=np.int32)
a = np.array(list(map(int, input().split())), dtype=np.int32)
DP[0] = a
for i in range(n-1):
    for j in range(n):
        DP[i+1][j] = min(DP[i][j], DP[i][j-1])
ans = float("inf")
for i in range(n):
    ans = min(ans, sum(DP[i])+i*x)
print(int(ans))

Fixed submission:
n, x = map(int, input().split())
a = list(map(int, input().split()))

# 空間計算量を減らしてみる
DP = a[:]
ans = sum(DP)
for i in range(n-1):
    DP = [min(DP[j],DP[j-1]) for j in range(n)]
    ans = min(ans, sum(DP) + (i+1)*x)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, x = map(int, input().split())
a = list(map(int, input().split()))

# DP[i][j] = i回以下魔法を掛けられてj色のスライムができるとき、最初のコストの最小値
DP = [[0]*n for i in range(n)]
DP[0] = a
for i in range(n-1):
    for j in range(n):
        DP[i+1][j] = min(DP[i][j], DP[i][j-1])
ans = float("inf")
for i in range(n):
    ans = min(ans, sum(DP[i])+i*x)
print(ans)

Fixed submission:
n, x = map(int, input().split())
a = list(map(int, input().split()))

# 空間計算量を減らしてみる
DP = a[:]
ans = sum(DP)
for i in range(n-1):
    DP = [min(DP[j],DP[j-1]) for j in range(n)]
    ans = min(ans, sum(DP) + (i+1)*x)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n, a = list(map(int, input().split()))
xs = list(map(int, input().split()))

na = n*a
DP = [[0]*(na+1) for i in range(n+1)]
DP[0][0] = 1

for _ in range(n):
    x = xs[_]
    next = [[0]*(na+1) for i in range(n+1)]
    for i in range(n):
        for j in range(na+1):
            # xを使わないとき
            next[i][j] += DP[i][j]
            if j+x <= na:
                next[i+1][j+x] += DP[i][j]
    DP = next

# i枚使ったとき合計がi*aである場合の数
ans = 0
for i in range(1,n+1):
    ans += DP[i][i*a]
print(ans)

Fixed submission:
n, a = list(map(int, input().split()))
xs = list(map(int, input().split()))

na = n*a

DP = [[0]*(na+1) for i in range(n+1)]
DP[0][0] = 1

for _ in range(n):
    x = xs[_]
    next = [[0]*(na+1) for i in range(n+1)]
    for i in range(_+1):
        for j in range(na+1):
            # xを使わないとき
            next[i][j] += DP[i][j]
            if j+x <= na:
                next[i+1][j+x] += DP[i][j]
    DP = next

# i枚使ったとき合計がi*aである場合の数
ans = 0
for i in range(1,n+1):
    ans += DP[i][i*a]
print(ans)
Buggy python submission (verdict: Runtime Error):
from bisect import bisect_right

n = int(input())
x = list(map(int, input().split()))
l = int(input())

depth = [-1]*n
depth[-1] = 0

m = 18
par = [[-1]*n for i in range(m)]

def dfs(i):
    if depth[i] >= 0:
        return depth[i]
    j = bisect_right(x, x[i]+l)-1
    if j >= n:
        j = n-1
    par[0][i] = j
    depth[i] = dfs(j) + 1
    return depth[i]

for i in range(n):
    dfs(i)

for i in range(17):
    for j in range(n):
        par[i+1][j]=par[i][par[i][j]]

def hoge(x, y):
# xからk個上の頂点がy以上になる最小のkを求める
    k = 0
    for i in range(18)[::-1]:
        if 0 <= par[i][x] <= y:
            k += 1<<i
            x = par[i][x]
    return k

q = int(input())
ans = []
for i in range(q):
    a,b = map(int, input().split())
    a,b = a-1,b-1
    if a > b:
        a,b = b,a
    ans.append(hoge(a, b))

print(*ans, sep="\n")

Fixed submission:
import sys
input = sys.stdin.readline

from bisect import bisect

n = int(input())
x = list(map(int, input().split()))
l = int(input())

m = 20
par = [[-1]*n for i in range(m)]

for i in range(n):
    j = bisect(x, x[i]+l)-1
    par[0][i] = j

for i in range(m-1):
    for j in range(n):
        par[i+1][j]=par[i][par[i][j]]

def hoge(x, y):
    k = 0
    for i in range(m)[::-1]:
        if par[i][x] < y:
            k += 1<<i
            x = par[i][x]
    return k+1

q = int(input())
ans = []
for i in range(q):
    a,b = map(int, input().split())
    a,b = a-1,b-1
    if a > b:
        a,b = b,a
    print(hoge(a,b))
Buggy python submission (verdict: Runtime Error):
import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__

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

cnt = [0]
def search(cur, prev, depth, k):
    if depth > k:
        cnt[0] += 1
    for to in G[cur]:
        if to != prev:
            search(to, cur, depth+1, k)


ans = float("inf")
# 点中心
if k % 2 == 0:
    for i in range(n):
        cnt = [0]
        search(i, -1, 0, k//2)
        ans = min(ans, cnt[0])
# 辺中心
else:
    for a, b in edges:
        cnt = [0]
        search(a, b, 0, k//2)
        search(b, a, 0, k//2)
        ans = min(ans, cnt[0])

print(ans)

Fixed submission:
import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__

sys.setrecursionlimit(10**9)


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

cnt = [0]
def search(cur, prev, depth, k):
    if depth > k:
        cnt[0] += 1
    for to in G[cur]:
        if to != prev:
            search(to, cur, depth+1, k)


ans = float("inf")
# 点中心
if k % 2 == 0:
    for i in range(n):
        cnt = [0]
        search(i, -1, 0, k//2)
        ans = min(ans, cnt[0])
# 辺中心
else:
    for a, b in edges:
        cnt = [0]
        search(a, b, 0, k//2)
        search(b, a, 0, k//2)
        ans = min(ans, cnt[0])

print(ans)
Buggy python submission (verdict: Runtime Error):
import collections

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
  

c = collections.Counter(prime_factorize(N))

A = c.keys()
count = c.values()

ans = 0

for i in count:
  k = 0
  for j in range(1,i):
    k += j
    if k <= i:
      ans += 1
print(ans)

Fixed submission:
N = int(input())

import collections

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
  

c = collections.Counter(prime_factorize(N))

A = c.keys()
count = c.values()

ans = 0

for i in count:
  k = 0
  for j in range(1,i+1):
    k += j
    if k <= i:
      ans += 1
      
print(ans)
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
H = []
for _ in range(N):
  h = int(input())
  H.append(h)
  
edge = [[] for _ in range(N+1)]

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

ans = 0

for i in range(1,N+1):
  h = H[i-1]
  for e in edge[i]:
    if h < h[e-1]:
      break
  else:
    ans += 1

print(ans)

Fixed submission:
n,m = map(int,input().split())
h = list(map(int,input().split()))
 
H = [0]*n
for p in range(n):
  H[p] = []
 
 
for _ in range(m):
  a,b = map(int,input().split())
 
  H[a-1].append(h[b-1])
  H[b-1].append(h[a-1])

ans = 0
i = 0
 
for one in H:
 
  i += 1
  if one == []:
    ans += 1
  else:
    for k in one:
      if k >= h[i-1]:
        break
    else:
      ans += 1
        
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
P = {}
Q = {}
X = {}
for i in range(N):
  p = i+1+A[i]
  q = i+1-A[i]
  if str(p) in P:
    P[str(p)] += 1
  else:
    P[str(p)] = 0
  if str(q) in Q:
    Q[str(q)] += 1
  else:
    Q[str(q)] = 0
  
  X.setdefalut(str(i+1+A[i]),i+1+A[i])
  X.setdefalut(str(i+1-A[i]),i+1-A[i])
  
#J[a]とI[b]が等しいのが条件
#とりうる値 < 10**9を全て試す
ans = 0

for key in X.keys():
  ans += P[key] * Q[key]
  
print(ans)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
P = {}
Q = {}
X = {}
for i in range(N):
  p = i+1+A[i]
  q = i+1-A[i]
  if str(p) in P:
    P[str(p)] += 1
  else:
    P[str(p)] = 1
  if str(q) in Q:
    Q[str(q)] += 1
  else:
    Q[str(q)] = 1
  X.setdefault(str(p),i+1+A[i])
  X.setdefault(str(q),i+1-A[i])

#J[a]とI[b]が等しいのが条件
#とりうる値 < 10**9を全て試す
ans = 0

for key in X.keys():
  if (key in P) and (key in Q):
  	ans += P[key] * Q[key]

print(ans)
Buggy python submission (verdict: Runtime Error):
A,B,N = map(int,input().split())
x = min(B-1,N)
print((A*x)//b - A*(x//b))


Fixed submission:
A,B,N = map(int,input().split())
x = min(B-1,N)
print((A*x)//B-A*(x//B))

Buggy python submission (verdict: Runtime Error):
A,B,N = map(int,input().split())
x = min(B-1,N)
print((A*x)//b-A*(x//b))


Fixed submission:
A,B,N = map(int,input().split())
x = min(B-1,N)
print((A*x)//B-A*(x//B))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
S = [input() for _ in range(n)]

count = 0
counted = []

for s in S:
  if s in counted:
    continue
  else:
    counted.append(s)
    count += 1
print(count)

Fixed submission:
n = int(input())
S = [input() for _ in range(n)]

import hashlib
base1 = 1007
mod1 = 10**9+7
dic = {}

for s in S:
  hs = hashlib.md5(s.encode()).hexdigest()
  dic.setdefault(hs, s)

print(len(dic))
Buggy python submission (verdict: Runtime Error):
#ABC145 E
N,T = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(N)]
ab.sort()

a = []
b = []
for ai, bi in ab:
    a.append(ai)
    b.append(bi)
    
dp = [[0 for j in range(T)] for _ in range(N+1)]
# i番目より前まで注文してT分以内(max T-1)で完食する
    
for i in range(N):
    for t in range(T): 
        if t+a[i] <= T-1:
        	dp[i+1][t+a[i]] =max(dp[i+1][t+a[i]],dp[i][t]+b[i])
        
        dp[i+1][t] = max(dp[i+1][t],dp[i][t])

#一番遅いものをラスト(T-1分)に注文
#i番目をラストに注文 = dp[i][t-1] + b[i]
ans = 0
for i in range(N):
    ans = max(ans,dp[i][t-1]+b[i])
    
print(ans)


Fixed submission:
n = int(input())

print(n**2)

Buggy python submission (verdict: Runtime Error):
x,y = map(int,input().split())
a = 1
b = 1
n = (2*y-x)//3
m = (2*x-y)//3

if (x+y)%3 == 0:
  for i in range(n+1,n+m+1):
    a *= i
  for j in range(1,m+1):
    b *= j
  print(a//b)
else:
  print(0)

Fixed submission:
n = int(input())

print(n**2)
Buggy python submission (verdict: Runtime Error):
x,y = map(int,input().split())
a = 1
b = 1
n = (2*y-x)//3
m = (2*x-y)//3

if (x+y)%3 == 0:
  for i in range(n+1,n+m+1):
    a *= i
  for j in range(1,m+1):
    b *= j
  print(a//b)
else:
  print(0)

Fixed submission:
n = int(input())
maps = [list(map(float,input().split())) for _ in range(n)]

ans = 0
for i in range(n):
    for j in range(n):
        if i == j:
            pass
        else:
            ans += ((maps[i][0]-maps[j][0])**2 + (maps[i][1]-maps[j][1])**2) **(1/2)
			
num = 1
for k in range(1,n+1):
    num *= k
print(ans/n)
Buggy python submission (verdict: Runtime Error):
A,B = [int(x) for x in input().spit()]

if (A>=10)&&(B>=10):
  print("-1")
else:
  print(A*B)


Fixed submission:
A,B = [int(x) for x in input().split()]

if (A>=10)or(B>=10):
  print("-1")
else:
  print(A*B)

Buggy python submission (verdict: Runtime Error):
A,B = int(input().split())

if (A>=10)&&(B>=10):
  print("-1")
else:
  print(A*B)


Fixed submission:
A,B = [int(x) for x in input().split()]

if (A>=10)or(B>=10):
  print("-1")
else:
  print(A*B)

Buggy python submission (verdict: Runtime Error):
A,B = int(input()).split()

if (A>=10)&&(B>=10):
  print("-1")
else:
  print(A*B)

Fixed submission:
A,B = [int(x) for x in input().split()]

if (A>=10)or(B>=10):
  print("-1")
else:
  print(A*B)

Buggy python submission (verdict: Runtime Error):
A,B = [int(i) i for input().split(" ")]

if A >= 10 && B >=10:
  print("-1")
else:
  print(A*B)
  

Fixed submission:
A,B = [int(x) for x in input().split()]

if (A>=10)or(B>=10):
  print("-1")
else:
  print(A*B)

Buggy python submission (verdict: Runtime Error):
if ((0<A<9)&&(0<B<9)):
  return A*B
else:
  return "-1"

Fixed submission:
A,B = [int(x) for x in input().split()]

if (A>=10)or(B>=10):
  print("-1")
else:
  print(A*B)
Buggy python submission (verdict: Runtime Error):
n = int(input())

import math
max = math.trunc(n**0.5)
for i in range(max:0:-1):
  if n % i == 0:
    j = n / i
    print(i+j-2)
  

Fixed submission:
n = int(input())
 
import math
max = math.trunc(n**0.5)
for i in range(max,0,-1):
  if n % i == 0:
    j = int(n / i)
    print(i+j-2)
    break
Buggy python submission (verdict: Runtime Error):
a.b = int(input().split())

if a <= b*2:
  print("0")
else:
  print(a-b*2)

Fixed submission:
a,b=map(int,input().split())

if a <= b*2:
  print("0")
else:
  print(a-b*2)
Buggy python submission (verdict: Runtime Error):
n = int(input())
import random

if n % 2 == 0:
  print(0.5)
else:
  print(n-1/2n)
  

Fixed submission:
n = int(input())
import random
 
print(1-(n//2)/n)
Buggy python submission (verdict: Runtime Error):
str = input()

if str == "Sunny":
  print("Cloudy")
elif str == "Cloudy":
  print("Rainy"):
else:
  print("Sunny")

Fixed submission:
str = input()
 
if str == "Sunny":
  print("Cloudy")
elif str == "Cloudy":
  print("Rainy")
else:
  print("Sunny")
Buggy python submission (verdict: Runtime Error):
strs = input()
 
for i in range(len(strs)):
  if !(i % 2 == 0):
    if (strs[i] == "L") or (strs[i] == "U") or (strs[i] == "D"):
      continue
    else:
      print("No")
      break
  else:
    if (strs[i] == "R") or (strs[i] == "U") or (strs[i] == "D"):
      continue
    else:
      print("No")
      break
else:
  print("Yes")

Fixed submission:
strs = input()
 
for i in range(len(strs)):
  if i % 2 != 0:
    if (strs[i] == "L") or (strs[i] == "U") or (strs[i] == "D"):
      continue
    else:
      print("No")
      break
  else:
    if (strs[i] == "R") or (strs[i] == "U") or (strs[i] == "D"):
      continue
    else:
      print("No")
      break
else:
  print("Yes")

Buggy python submission (verdict: Runtime Error):
strs = input()

for str in strs:
  if i % 2 == 0:
    if (i == "L") or (i == "U") or (i == "D"):
      continue
    else:
      print("No")
      break
  else:
    if (i == "R") or (i == "U") or (i == "D"):
      continue
    else:
      print("No")
      break
else:
  print("Yes")
    

Fixed submission:
strs = input()
 
for i in range(len(strs)):
  if i % 2 != 0:
    if (strs[i] == "L") or (strs[i] == "U") or (strs[i] == "D"):
      continue
    else:
      print("No")
      break
  else:
    if (strs[i] == "R") or (strs[i] == "U") or (strs[i] == "D"):
      continue
    else:
      print("No")
      break
else:
  print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
people_num, first_point, correct = map(int,input().split())
who_correct = [input() for i in range(correct)]
points = [first_point for i in range(people_num)]

for i in range(correct):
  for j in range(people_num):
    if j != int(who_correct[i])-1:
      points[j] -= 1
      if points[j] == 0:
        points[j] = - 100000000

for i in range(people_num):
  if points[i] < 0:
  	print("No")
  else:
    print("Yes")

Fixed submission:
people_num, first_point, correct = map(int,input().split())
who_correct = [input() for i in range(correct)]
points = [first_point-correct for i in range(people_num)]

 
for i in range(correct):
    points[int(who_correct[i])-1] += 1
    
for i in range(people_num):
  if points[i] <= 0:
  	print("No")
  else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
people_num, first_point, correct = map(int,input().split())
people = [input() for i in range(people_num)]
points = [correct for i in range(people_num)]
 
for i in range(correct):
  for j in range(people_num):
    if j != i:
      points[j] -= 1
      if points[j] == 0:
        prints[j] = - 100000000
        
for i in range(people_num):
  if points[i] < 0:
    print("No")
  else:
    print("Yes")

Fixed submission:
people_num, first_point, correct = map(int,input().split())
who_correct = [input() for i in range(correct)]
points = [first_point-correct for i in range(people_num)]

 
for i in range(correct):
    points[int(who_correct[i])-1] += 1
    
for i in range(people_num):
  if points[i] <= 0:
  	print("No")
  else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
people_num, first_point, correct = map(int,input().split())
people = [input() for i in range(people_num)]
points = [correct for i in range(people_num)]
 
for i in range(correct):
  for j in range(people_num):
    if j != i:
      points[j] -= 1
      if points[j] == 0:
        prints[j] = - 100000000
        
for i in range(people_num):
  if points[i] < 0:
  	print("No")
  else:
    print("Yes")

Fixed submission:
people_num, first_point, correct = map(int,input().split())
who_correct = [input() for i in range(correct)]
points = [first_point-correct for i in range(people_num)]

 
for i in range(correct):
    points[int(who_correct[i])-1] += 1
    
for i in range(people_num):
  if points[i] <= 0:
  	print("No")
  else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
people_num, first_point, correct = map(int,input().split())
people = [input() for i in range(people_num)]
points = [correct for i in range(people_num)]

for i in range(correct):
  for j in range(people_num):
    if j != i:
      points[j] -= 1
      if points[j] == 0:
        prints[j] = - 100000000

for i in range(people_num):
  if points[i] < 0:
  	print("No")
  else:
    print("Yes")

Fixed submission:
people_num, first_point, correct = map(int,input().split())
who_correct = [input() for i in range(correct)]
points = [first_point-correct for i in range(people_num)]

 
for i in range(correct):
    points[int(who_correct[i])-1] += 1
    
for i in range(people_num):
  if points[i] <= 0:
  	print("No")
  else:
    print("Yes")