Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
a.append(0)
x=a[0]
xi=1
ans=0
x_s=0
x_e=0
a_sum=a[0]
while x_e<n:
    if x_s==x_e:
        x_e+=1
        ans+=1
        xi=2
        x^=a[x_e]
        a_sum+=a[x_e]
    elif x==a_sum:
        ans+=xi
        xi+=1
        x_e+=1
        x=x^a[x_e]
        a_sum=a_sum+a[x_e]
    else:
        xi-=1
        x=x^a[x_s]
        a_sum=a_sum-a[x_a]
        x_s+=1

print(ans)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
a.append(0)
x=a[0]
xi=1
ans=0
x_s=0
x_e=0
a_sum=a[0]
while x_e<n:
    if x_s==x_e:
        x_e+=1
        ans+=1
        xi=2
        x^=a[x_e]
        a_sum+=a[x_e]
    elif x==a_sum:
        ans+=xi
        xi+=1
        x_e+=1
        x=x^a[x_e]
        a_sum=a_sum+a[x_e]
    else:
        xi-=1
        x=x^a[x_s]
        a_sum=a_sum-a[x_s]
        x_s+=1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
x=[0]
a_sum=[0]
for i in a:
    xi=x[-1]^i
    x.append(xi)
    ai=a_sum[-1]+i
    a_sum.append(ai)
ans=0
for i in range(n):
    for j in range(i,n):
        xij=x[i]^x[j+1]
        aij=a_sum[j+1]-a_sum[i]
        if xij==aij:
            ans+=1

print(ans)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
a.append(0)
x=a[0]
xi=1
ans=0
x_s=0
x_e=0
a_sum=a[0]
while x_e<n:
    if x_s==x_e:
        x_e+=1
        ans+=1
        xi=2
        x^=a[x_e]
        a_sum+=a[x_e]
    elif x==a_sum:
        ans+=xi
        xi+=1
        x_e+=1
        x=x^a[x_e]
        a_sum=a_sum+a[x_e]
    else:
        xi-=1
        x=x^a[x_s]
        a_sum=a_sum-a[x_s]
        x_s+=1

print(ans)
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if a%500 < b:
  print('Yes')
else('No')

Fixed submission:
a=int(input())
b=int(input())
if a%500 <= b:
  print('Yes')
else: print('No')

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if a%500<b:
  print('Yes')
else('No')

Fixed submission:
a=int(input())
b=int(input())
if a%500 <= b:
  print('Yes')
else: print('No')
Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
C=int(input())
x=int(input())
s=0
for i in range(A+1):
  if x<=0: break
  else:
    for t in range(B+1):
    if x<=0: break
    elif 50*C>=x:
      s+=1
      x-=100
    else: x-=100
  x-=500
print(s) 

Fixed submission:
A=int(input())
B=int(input())
C=int(input())
X=int(input())
s=0
for i in range(A+1):
  x=X-500*i
  if x<0: break
  for t in range(B+1):
    if x<0: break
    elif 50*C>=x:
      s+=1
      x-=100
    else: x-=100
print(s)

Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
C=int(input())
x=int(input())
s=0
for i in range(A+1):
  if x==0: break
  else:
    for t in range(B+1):
    if x==0: break
    elif 50*C>=x:
      s+=1
      x-=100
    else: x-=100
  x-=500
print(s) 

Fixed submission:
A=int(input())
B=int(input())
C=int(input())
X=int(input())
s=0
for i in range(A+1):
  x=X-500*i
  if x<0: break
  for t in range(B+1):
    if x<0: break
    elif 50*C>=x:
      s+=1
      x-=100
    else: x-=100
print(s)

Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
C=int(input())
x=int(input())
s=0
for i in range(A+1):
  if x=0: break
  else:
    for t in range(B+1):
    if x=0: break
    elif 50*C>=x:
      s+=1
      x-=100
    else: x-=100
  x-=500
print(s) 

Fixed submission:
A=int(input())
B=int(input())
C=int(input())
X=int(input())
s=0
for i in range(A+1):
  x=X-500*i
  if x<0: break
  for t in range(B+1):
    if x<0: break
    elif 50*C>=x:
      s+=1
      x-=100
    else: x-=100
print(s)

Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
C=int(input())
x=int(input())
s=0
for i in range(A+1):
  if x=0: break
  else:
    for t in range(B+1):
    if x=0: break
    else 50*C>=x:
      s+=1
      x-=100
  x-=500
print(s) 

Fixed submission:
A=int(input())
B=int(input())
C=int(input())
X=int(input())
s=0
for i in range(A+1):
  x=X-500*i
  if x<0: break
  for t in range(B+1):
    if x<0: break
    elif 50*C>=x:
      s+=1
      x-=100
    else: x-=100
print(s)
Buggy python submission (verdict: Runtime Error):
a, b = int(input().split())
if a*b % 2 == 1:
    print('Odd')
else:
    print('Even')

Fixed submission:
a, b = map(int, input().split())
if a*b % 2 == 1:
    print("Odd")
else:
    print("Even")

Buggy python submission (verdict: Runtime Error):
a, b =int(input().split())
if a*b % 2 == 1:
    print('Odd')
else:
    print('Even')


Fixed submission:
a, b = map(int, input().split())
if a*b % 2 == 1:
    print("Odd")
else:
    print("Even")

Buggy python submission (verdict: Runtime Error):
a, b = int(input())
if a*b % 2 == 1:
    print('Odd')
else:
    print('Even')

Fixed submission:
a, b = map(int, input().split())
if a*b % 2 == 1:
    print("Odd")
else:
    print("Even")

Buggy python submission (verdict: Runtime Error):
c=(a*b)%2
if c=1:
    print('Odd')
else: print('even')

Fixed submission:
a, b = map(int, input().split())
if a*b % 2 == 1:
    print("Odd")
else:
    print("Even")
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int, input().split()))
d=[]
for c in range(n):
  b=0
  while a[c]%2==0:
    a[c]=int(a[c]/2)
    b+=1
  d[c].append(b)
print(max(d))


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
d=[]
for c in range(n):
  b=0
  while a[c]%2==0:
    a[c]=int(a[c]//2)
    b+=1
  d.append(b)
print(min(d))

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int, input().split()))
d=[]
for c in range(n):
  b=0
  while a[c]%2==0:
    a[c]=a[c]//2
    b+=1
  d[c].append(b)
print(max(d))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
d=[]
for c in range(n):
  b=0
  while a[c]%2==0:
    a[c]=int(a[c]//2)
    b+=1
  d.append(b)
print(min(d))

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int, input().split()))
d=[]
for c in range(n):
  b=0
  while a[c]%2==0:
    a[c]=a[c]/2
    b+=1
  d[c].append(b)
print(max(d))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
d=[]
for c in range(n):
  b=0
  while a[c]%2==0:
    a[c]=int(a[c]//2)
    b+=1
  d.append(b)
print(min(d))

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
d=list()
for c in range(n):
  b=0
  while a[c]%2==0:
    a[c]=a[c]/2
    b+=1
  d[c].append(b)
print(max(d))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
d=[]
for c in range(n):
  b=0
  while a[c]%2==0:
    a[c]=int(a[c]//2)
    b+=1
  d.append(b)
print(min(d))
Buggy python submission (verdict: Runtime Error):
r,g,d=map(int, input().spilit)
if (100r+10g+d)%4==0:
  print("YES")
else: print("NO")

Fixed submission:
a,b,c= map(int, input().split())
if (100*a+10*b+c) % 4 == 0:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Runtime Error):
r,g,d=map(int, input().spilit)
if (100r+10g+d)%4=0:
  print("YES")
else: print("NO")

Fixed submission:
a,b,c= map(int, input().split())
if (100*a+10*b+c) % 4 == 0:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Runtime Error):
r,g,d=map(int, input().spilit)
if (100r+10g+d)%4=0:
  print('YES')
else: print('NO')

Fixed submission:
a,b,c= map(int, input().split())
if (100*a+10*b+c) % 4 == 0:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Runtime Error):
r,g,d=map(int, input().spilit)
if (100r+10g+D)%4=0:
  print('YES')
else: print('NO')

Fixed submission:
a,b,c= map(int, input().split())
if (100*a+10*b+c) % 4 == 0:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
import sys
mINF = -float('inf')
n,k = map(int, sys.stdin.readline().rstrip("\n").split())
p = [int(s)-1 for s in sys.stdin.readline().rstrip("\n").split()]
c = [int(s) for s in sys.stdin.readline().rstrip("\n").split()]
loop = []
for i in range(n):
    loop_costs = []
    lc = 0
    np = i
    while True:
        lc += c[p[np]]
        loop_costs.append(lc)
        np = p[np]
        if np == i:
            break
    loop.append(loop_costs)
ans = mINF
for i in range(n):
    loop_i = loop[i]
    if len(loop_i) < k:
        if loop_i[-1] > 0:
            q, mod = divmod(k, len(loop_i))
            modmax = max(loop_i[:mod])
            ans = max(ans,loop_i[-1]*q+modmax)
        else:
            ans = max(ans,max(loop_i))
    else:
        ans = max(ans,max(loop_i[:k]))
print(ans)

Fixed submission:
import sys
mINF = -float('inf')
n,k = map(int, sys.stdin.readline().rstrip("\n").split())
p = [int(s)-1 for s in sys.stdin.readline().rstrip("\n").split()]
c = [int(s) for s in sys.stdin.readline().rstrip("\n").split()]
loop = []
for i in range(n):
    loop_costs = []
    lc = 0
    np = i
    while True:
        lc += c[p[np]]
        loop_costs.append(lc)
        np = p[np]
        if np == i:
            break
    loop.append(loop_costs)
ans = mINF
for i in range(n):
    loop_i = loop[i]
    if len(loop_i) < k:
        if loop_i[-1] > 0:
            q, mod = divmod(k, len(loop_i))
            if mod == 0:
                q = q - 1
                modmax = max(loop_i)
            else:
                modmax = max(loop_i[:mod])
            ans = max(ans,loop_i[-1]*q+modmax)
        else:
            ans = max(ans,max(loop_i))
    else:
        ans = max(ans,max(loop_i[:k]))
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
import math

n = int(sys.stdin.readline().rstrip("\n"))
c = list(sys.stdin.readline().rstrip("\n"))
ans = 0
left, right = 0, len(arr) - 1

while(left < right):
    while(c[left] == 'R'):
        left += 1
        if left >= n:
            break
    while(c[right] == 'W'):
        right -= 1
        if right < 0:
            break
    if (left < right):
        c[left], c[right] = c[right], c[left]
        ans += 1
    else:
        break

print(ans)

Fixed submission:
import sys
import math

n = int(sys.stdin.readline().rstrip("\n"))
c = list(sys.stdin.readline().rstrip("\n"))
ans = 0
left, right = 0, n-1

while(left < right):
    while(c[left] == 'R'):
        left += 1
        if left >= n:
            break
    while(c[right] == 'W'):
        right -= 1
        if right < 0:
            break
    if (left < right):
        c[left], c[right] = c[right], c[left]
        ans += 1
    else:
        break

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
n,k = map(int, sys.stdin.readline().rstrip("\n").split())
a = [int(s) for s in sys.stdin.readline().rstrip("\n").split()]
p = 1
for i in range(k):
    p *= a[i]
for i in range(k,n):
    pnew = p * a[i]
    pnew = pnew // a[i-k]
    if p < pnew:
        print('Yes')
    else:
        print('No')
    p = pnew

Fixed submission:
import sys
n,k = map(int, sys.stdin.readline().rstrip("\n").split())
a = [int(s) for s in sys.stdin.readline().rstrip("\n").split()]
p = 1
for i in range(k,n):
    if a[i-k] < a[i]:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
import sys
n,k = map(int, sys.stdin.readline().rstrip("\n").split())
a = [int(s) for s in sys.stdin.readline().rstrip("\n").split()]
kmt = []
p = 1
for i in range(k):
    p *= a[i]
kmt.append(p)
for i in range(k,n):
    p = p * a[i] // a[i-k]
    kmt.append(p)
i = 0
while i+1< len(kmt):
    if kmt[i] < kmt[i+1]:
        print('Yes')
    else:
        print('No')
    i += 1

Fixed submission:
import sys
n,k = map(int, sys.stdin.readline().rstrip("\n").split())
a = [int(s) for s in sys.stdin.readline().rstrip("\n").split()]
p = 1
for i in range(k,n):
    if a[i-k] < a[i]:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
import sys
from collections import deque
h,w,k = map(int, sys.stdin.readline().rstrip("\n").split())
sx,sy,gx,gy = map(int, sys.stdin.readline().rstrip("\n").split())
sx,sy,gx,gy = sx-1,sy-1,gx-1,gy-1
labyrinth = [line.rstrip("\n") for line in sys.stdin]
INF = float('inf')
footprint = [ [[(INF,INF)]*4 for j in range(w)] for i in range(h) ]
m = [(-1, 0), (0, 1), (1, 0), (0, -1)]
q = deque()
for d in range(4):
    footprint[sx][sy][d] = (1,0)
    q.append((sx,sy,d,1,0))
while q:
    x, y, d, c, kk = q.popleft()
    for nd in range(4):
        if nd == d:
            mx,my = m[d]
            nkk = 1 if kk == k else kk + 1
            nc = c + 1 if kk == k else c
        else:
            mx,my = 0,0
            nkk = 0
            nc = c + 1
        nx = x + mx
        ny = y + my
        if 0 <= nx < h and 0 <= ny < w and labyrinth[nx][ny] == '.' and footprint[nx][ny][nd] > (nc, nkk):
            footprint[nx][ny][nd] = (nc, nkk)
            if nc == c:
                q.appendleft((nx, ny, nd, nc, nkk))
            else:
                q.append((nx, ny, nd, nc, nkk))
ans = INF
for d in range(4):
    ans = min(ans, footprint[gx][gy][d][0])
ans = -1 if ans == INF else ans
print(ans)

Fixed submission:
import sys
l = [int(s) for s in sys.stdin.readline().rstrip("\n").split()]
for i in range (5):
    if l[i] == 0:
        print(i+1)
        break
Buggy python submission (verdict: Runtime Error):
import sys
n = int(sys.stdin.readline().rstrip("\n"))
a = [int(s) for s in sys.stdin.readline().rstrip("\n").split()]
a.sort()
a_true = [True]*n
a_set = set(a)
if 1 in a or len(a_set) == 1:
    print(0)
else:
    a_max = a[n-1]
    i = 0
    while a[i]*2 <= a_max:
        while i < n-1:
            if a[i] == a[i+1]:
                a_true[i] = False
                a_true[i+1] = False
            i += 1
        for j in range(i+1,n):
            if a[j] % a[i] == 0:
                a_true[j] = False
        i += 1
    while i < n-1:
        if a[i] == a[i+1]:
            a_true[i] = False
            a_true[i+1] = False
        i += 1
    print(len([i for i in range(0, n) if a_true[i]]))

Fixed submission:
import sys
n = int(sys.stdin.readline().rstrip("\n"))
a = [int(s) for s in sys.stdin.readline().rstrip("\n").split()]
a_max = max(a)
c = {num: 0 for num in a}
for num in a:
    c[num] += 1
d = {num: 0 for num in a}
for num in a:
    t = 2
    while num * t <= a_max:
        d[num*t] = 1
        t += 1
ans = 0
for num in a:
    if c[num] == 1 and d[num] == 0:
        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
a,v = map(int, sys.stdin.readline().rstrip("\n").split())
b,w = map(int, sys.stdin.readline().rstrip("\n").split())
t = int(sys.stdin.readline().rstrip("\n"))
between = abs(b - a)
speed = w - v
if between <= speed*t
  print('YES')
else:
  print('NO')

Fixed submission:
import sys
a,v = map(int, sys.stdin.readline().rstrip("\n").split())
b,w = map(int, sys.stdin.readline().rstrip("\n").split())
t = int(sys.stdin.readline().rstrip("\n"))
between = abs(b - a)
speed = v-w
if between <= speed*t:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
import sys
n = int(sys.stdin.readline().rstrip("\n"))
l = [int(s) for s in sys.stdin.readline().rstrip("\n").split()]
s = 1
for i in l:
    s *= i
if s > 10**18:
    print(-1)
else:
    print(s)

Fixed submission:
import sys
n = int(sys.stdin.readline().rstrip("\n"))
l = [int(s) for s in sys.stdin.readline().rstrip("\n").split()]
s = 1
if 0 in l:
    print(0)
else:
    for i in l:
        s *= i
        if s > 10**18:
            print(-1)
            break
    else:
        print(s)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
n = int(sys.stdin.readline().rstrip("\n"))
l = [int(s) for s in sys.stdin.readline().rstrip("\n").split()]
s = 1
for i in l:
    s *= i
if s > 10**18:
    print(-1)
else:
    print(s)

Fixed submission:
import sys
n = int(sys.stdin.readline().rstrip("\n"))
l = [int(s) for s in sys.stdin.readline().rstrip("\n").split()]
s = 1
if 0 in l:
    print(0)
else:
    for i in l:
        s *= i
        if s > 10**18:
            print(-1)
            break
    else:
        print(s)
Buggy python submission (verdict: Runtime Error):
import sys
n,m,x= map(int, sys.stdin.readline().rstrip("\n").split())
lines = [ [int(s) for s in line.split()] for line in sys.stdin ]
n = 3
price = -1
skill = {}
for i in range(2**n-1):
    i = format(i+1, 'b').zfill(n)
    price_ = 0
    for j in range (m):
        skill[j] = 0
    for j in range(n):
        if i[j] == '1':
            price_  += lines[j][0]
            for k in range(m):
                skill[k] = skill[k] + lines[j][k+1]
        for k in range(m):
            if skill[k] < x:
                break
        else:
            if price == -1:
                price = price_
            else:
                price = min(price, price_)
print(price)

Fixed submission:
import sys
s = sys.stdin.readline().rstrip("\n")
t = sys.stdin.readline().rstrip("\n")
if s == t[:-1]:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
h = list(map(int, input().split()))
islands = []
for i in range(n):
    islands.append(i)
for i in range(m):
    a, b = map(int, input().split())
    a, b = a-1, b-1
    if h[a] > h[b]:
        if b in islands:
            islands.remove(b)
    elif h[a] < h[b]:
        if a in islands:
            islands.remove(a)
    else:
        if a in islands:
            islands.remove(a)
        if b in islands:
            islands.remove(b)
print(len(islands))

Fixed submission:
n, m = map(int, input().split())
h = list(map(int, input().split()))
maxh = []
for height in h:
    maxh.append(0)
for i in range(m):
    a, b = map(int, input().split())
    a, b = a-1, b-1
    maxh[a] = max(maxh[a], h[b])
    maxh[b] = max(maxh[b], h[a])
g = 0
for height, maxheight in zip(h, maxh):
    if height > maxheight:
        g += 1
print(g)
Buggy python submission (verdict: Runtime Error):
k = list(input())
a, b =  map(int, input().split())
if a % k == 0 or b % k == 0:
    print('OK')
else:
    if (b-a) // k == 0:
        print('NG')
    else:
        print('OK')

Fixed submission:
k = int(input())
a, b =  map(int, input().split())
l = 0
for i in range(b // k):
    if a <= k*(i+1) <= b:
        l = 1
        print('OK')
        break
if l == 0:
    print('NG')
Buggy python submission (verdict: Runtime Error):
n = int(sys.stdin.readline().rstrip("\n"))
if n % 2 == 0:
    print(n // 2)
else:
    print(n // 2 + 1)

Fixed submission:
import sys
n = int(sys.stdin.readline().rstrip("\n"))
if n % 2 == 0:
    print(n // 2)
else:
    print(n // 2 + 1)
Buggy python submission (verdict: Runtime Error):
x,y = map(int, sys.stdin.readline().rstrip("\n").split())
print(x+y/2)

Fixed submission:
import sys
x,y = map(int, sys.stdin.readline().rstrip("\n").split())
print(x+y//2)

Buggy python submission (verdict: Runtime Error):
n, m =  map(int, input().split())
py = [map(int, input().split()) for _ in range(m)]
p, y = [list(i) for i in zip(*py)]
pre = {}
for i in range(m):
    if p[i] not in pre.keys():
        pre[p[i]] = []
    pre[p[i]].append(y[i])
for i in pre.keys():
    pre[i].sort()
for i in range(m):
    num = str(p[i]*(10**6)+(pre[p[i]].index(y[i])+1))
    while len(num) < 12:
        num = '0' + num
    print(num)

Fixed submission:
import sys
x,y = map(int, sys.stdin.readline().rstrip("\n").split())
print(x+y//2)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = int(input())
n = n - 500*(n//500)
if n =< a:
    print('Yes')
else:
    print('No')

Fixed submission:
n = int(input())
a = int(input())
n = n - 500*(n//500)
if n <= a:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
import sys
n = int(sys.stdin.readline())
a = [int(s) for s in sys.stdin.readline().split()]
a.sort(reverse=True)
a_sum = 0
b_sum = 0
for i in range(n):
    if i % 2 == 1:
        a_sum += a[i]
    else:
        b_sum += b[i]
print(a_sum - b_sum)

Fixed submission:
import sys
n = int(sys.stdin.readline())
a = [int(s) for s in sys.stdin.readline().split()]
a.sort(reverse=True)
a_sum = 0
b_sum = 0
for i in range(n):
    if i % 2 == 0:
        a_sum += a[i]
    else:
        b_sum += a[i]
print(a_sum - b_sum)
Buggy python submission (verdict: Runtime Error):
n = int(sys.stdin.readline().rstrip("\n"))
i = 0
while True:
    if 2**i <= n:
        i += 1
    else:
        break
print(2**i)

Fixed submission:
import sys
n = int(sys.stdin.readline().rstrip("\n"))
i = 0
while 2**i <= n:
    i += 1
print(2**(i-1))
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
print(a-n*2)

Fixed submission:
a, b = map(int, input().split())
c = max(a-b*2, 0)
print(c)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
n, k, q= map(int, input().split())
a=[k]*n
for i in range(q):
    p = int(input())
    for j in range(n):
        if (p-1) != j:
            a[j]-=1
for i in range(n):
    if a[i] > 0:
        print("Yes")
    else:
        print("No")

Fixed submission:
# -*- coding: utf-8 -*-
n, k, q= map(int, input().split())
a=[k]*n
for i in range(q):
    p = int(input())
    a[p-1]+=1
for i in range(n):
    if a[i]-q > 0:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
r, g, b, n = map(int, input().split())
count=0
for i in range(0,(int)(n/r)+1):
    for j in range(0, (int)(n/g)+1):
        if (n-i*r-j*g)%b == 0 and (n-i*r-j*g)>=0:
            count+=1

print(count)

Fixed submission:
r, g, b, n = map(int, input().split())
count=0
for i in range(0,(int)(n/r)+1):
    for j in range(0, (int)((n-i*r)/g)+1):
        v = n-i*r-j*g
        if v%b == 0 and v>=0:
            count+=1

print(count)
Buggy python submission (verdict: Runtime Error):
k = input()
str = ''
for _ in range(k):
  str += 'ACL'
print(str)

Fixed submission:
k = int(input())
str = ''
for _ in range(k):
  str += 'ACL'
print(str)
Buggy python submission (verdict: Runtime Error):
class UnionFind():
  def __init__(self, n):
    self.n = n
    self.parents = [-1] * n

  def find(self, x):
    if self.parents[x] < 0:
      return x
    else:
      self.parents[x] = self.find(self.parents[x])
      return self.parents[x]

  def union(self, x, y):
    x = self.find(x)
    y = self.find(y)

    if x == y:
      return

    if self.parents[x] > self.parents[y]:
      x, y = y, x

    self.parents[x] += self.parents[y]
    self.parents[y] = x

  def size(self, x):
    return -self.parents[self.find(x)]

  def same(self, x, y):
    return self.find(x) == self.find(y)

  def members(self, x):
    root = self.find(x)
    return [i for i in range(self.n) if self.find(i) == root]

  def roots(self):
    return [i for i, x in enumerate(self.parents) if x < 0]

  def group_count(self):
    return len(self.roots())

  def all_group_members(self):
    return {r: self.members(r) for r in self.roots()}

  def __str__(self):
    return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

n, m = map(int, input().split())
uf = UnionFind(n)

for _ in range(m):
  a, b = map(int, input().split())
  uf.union(a,b)
  
print(uf.group_count() - 1)



Fixed submission:
class UnionFind():
  def __init__(self, n):
    self.n = n
    self.parents = [-1] * n

  def find(self, x):
    if self.parents[x] < 0:
      return x
    else:
      self.parents[x] = self.find(self.parents[x])
      return self.parents[x]

  def union(self, x, y):
    x = self.find(x)
    y = self.find(y)

    if x == y:
      return

    if self.parents[x] > self.parents[y]:
      x, y = y, x

    self.parents[x] += self.parents[y]
    self.parents[y] = x

  def size(self, x):
    return -self.parents[self.find(x)]

  def same(self, x, y):
    return self.find(x) == self.find(y)

  def members(self, x):
    root = self.find(x)
    return [i for i in range(self.n) if self.find(i) == root]

  def roots(self):
    return [i for i, x in enumerate(self.parents) if x < 0]

  def group_count(self):
    return len(self.roots())

  def all_group_members(self):
    return {r: self.members(r) for r in self.roots()}

  def __str__(self):
    return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

n, m = map(int, input().split())
uf = UnionFind(n)

for _ in range(m):
  a, b = map(int, input().split())
  uf.union(a-1,b-1)
  
print(uf.group_count() - 1)