Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
var = [int(e) for e in input().split()]
n = var[0]
k = var[1]
x = var[2]
y = var[3]
if n>k:
    print(k*x+(n-k)*y)
else:
    print(n*x)

Fixed submission:
var = [int(input()) for i in range(4)]
n = var[0]
k = var[1]
x = var[2]
y = var[3]
if n>k:
    print(k*x+(n-k)*y)
else:
    print(n*x)

Buggy python submission (verdict: Runtime Error):
var = [int(e) for e in input().split()]
n = var[0]
k = var[1]
x = var[2]
y = var[3]
if n>k:
    print(k*x+(n-k)*y)
else:
    print(k*x)

Fixed submission:
var = [int(input()) for i in range(4)]
n = var[0]
k = var[1]
x = var[2]
y = var[3]
if n>k:
    print(k*x+(n-k)*y)
else:
    print(n*x)
Buggy python submission (verdict: Time Limit Exceeded):
n, a = map(int, input().split())
l = [int(i) for i in input().split()]

dp = [[[0] * 2501 for j in range(51)] for i in range(51)]

dp[0][0][0] = 1

for i in range(n):
    for j in range(51):
        for k in range(2501):
            if k >= l[i] and j >= 1:
                dp[i+1][j][k] = dp[i][j][k] + dp[i][j-1][k-l[i]]
            else:
                dp[i+1][j][k] = dp[i][j][k]

print(sum([dp[n][m][a*m] for m in range(1, n+1)]))

Fixed submission:
n, a = map(int, input().split())
l = [int(i) for i in input().split()]

dp = [[[0] * 2501 for j in range(51)] for i in range(51)]

dp[0][0][0] = 1

for i in range(n):
    for j in range(51):
        for k in range(2501):
            if k >= l[i] and j >= 1:
                dp[i+1][j][k] = dp[i][j][k] + dp[i][j-1][k-l[i]]
            else:
                dp[i+1][j][k] = dp[i][j][k]

print(sum([dp[n][m][a*m] for m in range(1, n+1)]))
Buggy python submission (verdict: Runtime Error):
n = int(input())

ac_counter = 0
wa_counter = 0
tle_counter = 0
re_counter = 0

for i in range(n):
  str = input()
  if str == "AC":
    ac_counter += 1
  elif str == "WA":
    wa_counter += 1
  elif str == "TLE":
    tle_counter += 1
  else :
    re_counter += 1
print("AC x "+str(ac_counter))
print("WA x "+str(wa_counter))
print("TLE x "+str(tle_counter))
print("RE x "+str(re_counter))

Fixed submission:
n = int(input())
 
ac_counter = 0
wa_counter = 0
tle_counter = 0
re_counter = 0
 
for i in range(n):
  str = input()
  if str == "AC":
    ac_counter += 1
  elif str == "WA":
    wa_counter += 1
  elif str == "TLE":
    tle_counter += 1
  else :
    re_counter += 1
print("AC x",ac_counter)
print("WA x",wa_counter)
print("TLE x",tle_counter)
print("RE x",re_counter)
Buggy python submission (verdict: Runtime Error):
a,b = int(input().split())

print(a*b)

Fixed submission:
a = list(map(int, input().split()))
 
print(a[0]*a[1])
Buggy python submission (verdict: Runtime Error):
a = input().split()[0]
b = input().split()[1]
a = int(a)
b = float(b)

print(int(a*b))

Fixed submission:
l = input().split()
 
a = l[0]
b = l[1]
 
a = int(a)
b = float(b) * 1000
b = int(b)
ks = a * b 
print(int(ks // 1000))

Buggy python submission (verdict: Runtime Error):
a,b = int(input().split())

print(int(a*b))

Fixed submission:
l = input().split()
 
a = l[0]
b = l[1]
 
a = int(a)
b = float(b) * 1000
b = int(b)
ks = a * b 
print(int(ks // 1000))
Buggy python submission (verdict: Runtime Error):
import math

#試し割法
def trial_division(n):
    #素因数を格納するリスト
    factor = []
    #2から√n以下の数字で割っていく
    tmp = int(math.sqrt(n)) + 1
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            factor.append(num)
    #リストが空ならそれは素数
    if not factor:
        return 'prime number'
    else:
        factor.append(n)
        return factor
      
n = int(input())
n_list = trial_division(n)
ans = 0
z = []
for i in range(len(n_list)):
  if n_list[i] == 1:
    break
  else:
    if n % n_list[i] == 0:
      z.append(n_list[i])
      n = n / n_list[i]
      ans += 1
print(ans)

Fixed submission:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr
      
n = int(input())
n_list = factorization(n)
oh = []
for i in range(len(n_list)):
  num = n_list[i][0] #2の
  kata = n_list[i][1] #3乗
  for i in range(1, kata+1):
    oh.append(num ** i)
oh.sort()
ans = 0
z = []
for i in range(len(oh)):
  if oh[i] == 1:
    break
  else:
    if n % oh[i] == 0 and oh[i] not in z:
      z.append(oh[i])
      n = n / oh[i]
      ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
 
a,b,n = map(int,input().split())
 
ans = 0
pre = 0
for i in range(1, n+1):
  now = math.floor(a*i / b) - a * math.floor(i / b)
  if now > pre:
    ans = i
    pre = now
  elif not now == 0:
    break
    
print(pre)

Fixed submission:
k = int(input())
 
a, b = map(int, input().split())
ngcounter = 0
for i in range(a, b+1):
  if i % k == 0:
    break
  else:
    ngcounter += 1
    
if ngcounter == b - a + 1:
  print("NG")
else :
  print("OK")

Buggy python submission (verdict: Runtime Error):
import math
 
a,b,n = map(int,input().split())
 
ans = 0
pre = 0
for i in range(1, n+1):
  now = math.floor(a*i / b) - a * math.floor(i / b)
  if now > pre:
    ans = i
    pre = now
  else:
    break
    
print(pre)

Fixed submission:
k = int(input())
 
a, b = map(int, input().split())
ngcounter = 0
for i in range(a, b+1):
  if i % k == 0:
    break
  else:
    ngcounter += 1
    
if ngcounter == b - a + 1:
  print("NG")
else :
  print("OK")

Buggy python submission (verdict: Runtime Error):
k = int(input())
 
a, b = map(int, input().split())
necounter = 0
for i in range(a, b+1):
  if i % k == 0:
    break
  else:
    ngcounter += 1
    
if ngcounter == b - a + 1:
  print("NG")
else :
  print("OK")


Fixed submission:
k = int(input())
 
a, b = map(int, input().split())
ngcounter = 0
for i in range(a, b+1):
  if i % k == 0:
    break
  else:
    ngcounter += 1
    
if ngcounter == b - a + 1:
  print("NG")
else :
  print("OK")
Buggy python submission (verdict: Runtime Error):
n = input()
sum = 0
for i in range(n):
  if i % 3 != 0 and i % 5 != 0:
    sum += i
    
print(sum)

Fixed submission:
n = int(input())
sum = 0
for i in range(1, n+1):
  if i % 3 != 0 and i % 5 != 0:
    sum += i
    
print(sum)

Buggy python submission (verdict: Runtime Error):
n = input()
sum = 9
for i in range(n):
  if i % 3 != 0 and i % 5 != 0:
    sum += i
    
print(sum)

Fixed submission:
n = int(input())
sum = 0
for i in range(1, n+1):
  if i % 3 != 0 and i % 5 != 0:
    sum += i
    
print(sum)
Buggy python submission (verdict: Time Limit Exceeded):
import math
 
 
def gcd(a, b, c):
  d = math.gcd(a, b)
  return math.gcd(c, d)
 
K = int(input())
sum = 0
 
for i in range(1, K+1):
  for j in range(1, K+1):
    for k in range(1, K+1):
      sum += gcd(i, j, k)
      
print(sum)

Fixed submission:
import math
 
 
def gcd(a, b, c):
  d = math.gcd(a, b)
  return math.gcd(c, d)
 
K = int(input())
sum = 0
for i in range(1, K+1):
  sum += gcd(i, i, i)
  
for i in range(1, K+1):
  for j in range(i, K+1):
    for k in range(j, K+1):
      if i == j and j == k:
        sum += 0
      elif i == j or j == k or i == k:
        sum += gcd(i , j , k )*3
      elif i != j and j != k :
        sum += gcd(i, j, k)*6

print(sum)

Buggy python submission (verdict: Runtime Error):
import math


def gcd(a, b, c):
  d = math.gcd(a, b)
  return math.gcd(c, d)

K = int(input())
sum = 0

for i in range(1, a+1):
  for j in range(1, b+1):
    for k in range(1, c+1):
      sum += gcd(i, j, k)
      
print(sum)

Fixed submission:
import math
 
 
def gcd(a, b, c):
  d = math.gcd(a, b)
  return math.gcd(c, d)
 
K = int(input())
sum = 0
for i in range(1, K+1):
  sum += gcd(i, i, i)
  
for i in range(1, K+1):
  for j in range(i, K+1):
    for k in range(j, K+1):
      if i == j and j == k:
        sum += 0
      elif i == j or j == k or i == k:
        sum += gcd(i , j , k )*3
      elif i != j and j != k :
        sum += gcd(i, j, k)*6

print(sum)
Buggy python submission (verdict: Runtime Error):
bingo = []
bingo[0] , bingo[1] , bingo[2] = map(int, input().split())
bingo[3] , bingo[4], bingo[5] = map(int, input().split())
bingo[6], bingo[7], bingo[8] = map(int, input().split())
n = int(input())
ls = []
counter = 0
for i in range(n):
  ls[i] = int(input())

for i in range(len(bingo)):
  for j in range(len(ls)):
    if ls[j] == bingo[i]:
      bingo[i] = 0
      break
for i in range(len(bingo)):
  if i == 0:
    if bingo[i] + bingo[i+1] + bingo[i+2] == 0:
      counter += 1
      break
    elif bingo[i] + bingo[i+3] + bingo[i+6] == 0:
      counter += 1
      break
    elif bingo[i] + bingo[i+4] + bingo[i+8] == 0:
      counter += 1
      break
  elif i == 1:
    if bingo[i] + bingo[i+3] + bingo[i+6] == 0:
      counter += 1
      break
  elif i == 2:
    if bingo[i] + bingo[i+3] + bingo[i+6] == 0:
      counter += 1
      break
    elif bingo[i] + bingo[i+2] + bingo[i+4] == 0:
      counter += 1
      break
  elif i == 3:
    if bingo[i] + bingo[i+1] + bingo[i+2] == 0:
      counter += 1
      break
  elif i == 6:
    if bingo[i] + bingo[i+1] + bingo[i+2] == 0:
      counter += 1
      break
if counter > 0:
  print("Yes")
else: 
  print("No")
  

Fixed submission:
bingo = [1,1,1,1,1,1,1,1,1]
bingo[0] , bingo[1] , bingo[2] = map(int, input().split())
bingo[3] , bingo[4], bingo[5] = map(int, input().split())
bingo[6], bingo[7], bingo[8] = map(int, input().split())
n = int(input())
ls = []
counter = 0
for i in range(n):
  ls.append(int(input()))
 
for i in range(len(bingo)):
  for j in range(len(ls)):
    if ls[j] == bingo[i]:
      bingo[i] = 0
      break
for i in range(len(bingo)):
  if i == 0:
    if bingo[i] + bingo[i+1] + bingo[i+2] == 0:
      counter += 1
      break
    elif bingo[i] + bingo[i+3] + bingo[i+6] == 0:
      counter += 1
      break
    elif bingo[i] + bingo[i+4] + bingo[i+8] == 0:
      counter += 1
      break
  elif i == 1:
    if bingo[i] + bingo[i+3] + bingo[i+6] == 0:
      counter += 1
      break
  elif i == 2:
    if bingo[i] + bingo[i+3] + bingo[i+6] == 0:
      counter += 1
      break
    elif bingo[i] + bingo[i+2] + bingo[i+4] == 0:
      counter += 1
      break
  elif i == 3:
    if bingo[i] + bingo[i+1] + bingo[i+2] == 0:
      counter += 1
      break
  elif i == 6:
    if bingo[i] + bingo[i+1] + bingo[i+2] == 0:
      counter += 1
      break
if counter > 0:
  print("Yes")
else: 
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int,input().split())
pointer = 0
while (k**pointer <= n):
  if k**pointer < n:
    pointer += 1
    
print(pointer)

Fixed submission:
n, k = map(int,input().split())
pointer = 0
while (k**pointer <= n):
    pointer += 1
    
print(pointer)
Buggy python submission (verdict: Runtime Error):
n = int(input())
x = []
sum = 0
for i in range(n):
  s = int(input())
  sum += s
  x.append(s)
  
ave = s//n
sum = 0
for i in range(n):
  sum += (x[i] - ave)**2
min = sum
sum = 0
for i in range(n):
  sum += (x[i] - ave - 1)**2
max = sum 

if min > max:
  print(max)
else:
  print(min)

Fixed submission:
n = int(input())
x = list(map(int, input().split()))
sum = 0
for i in range(n):
  sum += x[i]
  
ave = sum//n
sum = 0
for i in range(n):
  sum += (x[i] - ave)**2
min = sum
sum = 0
for i in range(n):
  sum += (x[i] - ave - 1)**2
max = sum 
 
if min > max:
  print(max)
else:
  print(min)
Buggy python submission (verdict: Runtime Error):
s, t = intput().split("")
a, b = map(int, input().split(""))
u = input()

if u == t :
  num = b - 1
  print(a, num)
else:
  num = a - 1
  print(num, b)

Fixed submission:
str = input().split()
s = str[0]
t = str[1]
a, b = map(int, input().split())
u = input()
 
if u == t :
  num = b - 1
  print(a, num)
else:
  num = a - 1
  print(num, b)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

a = list(map(int, input().split()))
ngcounter = 0
for i in range(n):
  num = a[i]
  a[i] = num - 1
  if num in a:
    ngcounter += 1
    break
  else:
    a[i] += 1
    
if ngcounter > 0:
  print("NO")
else:
  print("YES")

Fixed submission:
n = int(input())

a = list(map(int, input().split()))
ngcounter = 0
a.sort()
for i in range(n-1):
  if a[i] == a[i+1]:
    ngcounter += 1
    break
  
if ngcounter > 0:
  print("NO")
else:
  print("YES")
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
 
h = list(map(int, inoput().split))
sum = 0
h.sort()

if n < k:
  print(0)
else:
   for i in range(0, k):
    h[n-i-1] = 0
  
   for i in range(0, n):
    sum += h[i]
  print(sum)

Fixed submission:
n, k = map(int, input().split())
 
h = list(map(int, input().split()))
sum = 0
h.sort()

if n <= k:
  print(0)
else:
   for i in range(0, k):
    h[n-i-1] = 0
  
   for i in range(0, n):
    sum += h[i]
   
   print(sum)

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())

h = list(map(int, inoput().split))
sum = 0
h.sort()

for i in range(0, k):
  h[n-i-1] = 0
  
for i in range(0, n):
  sum += h[i]
  
print(sum)

Fixed submission:
n, k = map(int, input().split())
 
h = list(map(int, input().split()))
sum = 0
h.sort()

if n <= k:
  print(0)
else:
   for i in range(0, k):
    h[n-i-1] = 0
  
   for i in range(0, n):
    sum += h[i]
   
   print(sum)
Buggy python submission (verdict: Runtime Error):
# AC を 1回以上出した各問題において、初めて AC を出すまでに出した WA の数
n,m = map(int, input().split())
p = []
s = []
wacounter = 0
walist = []
for i in range(0, n):
  walist.append(0)
point = 0
point_to_num = [] #acをとった問題
for i in range(0, m):
  list = input().split()
  p.append(int(list[0]))
  s.append(list[1])
 
for i in range(0, m):
  if s[i] == "AC" and not p[i] in point_to_num: #もし正解で、今までにその問題に正解していなかったら
    point_to_num.append(p[i]) #正解リストにその問題を追加
    #point = point + 1 正解ポイントをあげる
  elif s[i] == "WA" and not p[i] in point_to_num: #不正解かつ今まで正解を出したことがない
      wacounter += 1
      walist[p[i]-1] += 1
for i in range(0, n):
  if not i + 1 in point_to_num:#もし正解してない番号があったら、walistからwacounterをとってきてひく
    wacounter = wacounter - walist[i]
print(len(point_to_num), wacounter)
    


Fixed submission:
s = input()
n = ord(s)

print(chr(n+1))
Buggy python submission (verdict: Runtime Error):
n = int(input()) # length of string
str = input()
mid = n / 2 # the first char in later str
counter = 0
for i in range(mid):
  if n % 2 != 0:
    print("No")
    break
  elif str[i] == str[mid + i]:
    counter += 1
    
if counter == mid :
  print("Yes")

Fixed submission:
n = int(input()) # length of string
str = input()
mid = n // 2 # the first char in later str
counter = 0
if n % 2 != 0:
  print("No")
else:
  for i in range(mid):
    if str[i] == str[mid + i]:
      counter += 1   
  if counter == mid :
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import math
a, b, x = map(int, input().split())
 
h = x / (a * a) #height 
if h > b / 2:
  shahen = 4 * (b - x/(a * a) * (b - x/(a * a))) + a * a
  sin = a / (math.sqrt(shahen))
  print(90 - math.degrees(math.asin(sin)))
elif h == b / 2:
  print(45.0000000000)
else:
  shahen = 4 * x * x + (a * a * a * a) * b * b
  sin = 2 * x / (math.sqrt(shahen))
  print(90 - math.degrees(math.asin(sin)))


Fixed submission:
a, b = map(int, input().split())
 
if a <= 9 and a >= 1 and b <= 9 and b >= 1:
  print(a * b)
else :
  print(-1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
counter  = 0
for i in range(10):
  if n mod i == 0:
    if(n / i <= 9):
      print("Yes")
      counter += 1
      break
  
if counter == 0:
  print("No")

Fixed submission:
n = int(input())
counter  = 0
for i in range(1, 10):
  if n % i == 0:
    if(n / i <= 9):
      print("Yes")
      counter += 1
      break
  
if counter == 0:
  print("No")
Buggy python submission (verdict: Runtime Error):
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
  
n = int(input())
ls = prime_factorize(n)

for i in range(len(ls) //2 + 1):
  ans = []
  ans.append(i + n / i - 2)

ans.sort()
print(ans[0])



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

    # divisors.sort()
    return divisors
  
n = int(input())
ls = prime_factorize(n)
for i in range(len(ls)):
  ans = []
  pair = n // ls[i]
  ans.append(ls[i] + n // ls[i] - 2)
 
ans.sort()
print(ans[0])
Buggy python submission (verdict: Runtime Error):
n = int(inout()) # the number of takoyaki
delicious = list(map(int,input().split()))
ans = 0
for i in range(0, n-1): 
  for j in range(i, n):
    ans += delicious[i] * delicious[j]
    
print(ans)

Fixed submission:
n = int(input()) # the number of takoyaki
delicious = list(map(int,input().split()))
ans = 0
for i in range(0, n-1): 
  for j in range(i+1, n):
    ans += delicious[i] * delicious[j]
    
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
str = input()

for i in range(len(str)-1):
  if str[i] == str[i+1]:
    del str[i]
    
print(len(str))    

Fixed submission:
n = int(input())
str =list(input())
count = 1
for i in range(n-1):
  if str[i] != str[i + 1]:
    count += 1
    
    
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
 
ls = list(map(int, input().split()))

def find(list, n):
  for i in range(len(list)):
    if list[i] == n:
      return i+1
    
for i in range(n):
  a = find(ls, i+1) #f(ls,1) -> a = 3 
  print(a, end=" ")


Fixed submission:
n = int(input())
 
ls = list(map(int, input().split()))
ans = []

for i in range(n):
  ans.append(0)
  
for i in range(n):
  ans[ls[i]-1] = i + 1
  
for i in range(n):
  print(ans[i], end = " ")

Buggy python submission (verdict: Runtime Error):
n = int(input())

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

queue = []

for i in range(n)
	a = ls[i] - 1
  	queue[a] = i

    
print(queue)

Fixed submission:
n = int(input())
 
ls = list(map(int, input().split()))
ans = []

for i in range(n):
  ans.append(0)
  
for i in range(n):
  ans[ls[i]-1] = i + 1
  
for i in range(n):
  print(ans[i], end = " ")
Buggy python submission (verdict: Runtime Error):
x, y  = map(int, input().split())

def prime_factorize(a):
  ls = [1]
  if a == 1:
    return ls
  else:
  	while(i <= a):
      if(a % i == 0):
        ls.append(i)
      i += 1
    return ls
  
prime_x = prime_factorize(x)
prime_y = prime_factorize(y)

num_x = len(prime_x)
num_y = len(prime_y)

num = min(num_x, num_y)
co = list(set(num_x) & set(num_y))
ans = 0
for i in range(len(co)):
  if co == [1]:
    ans = 1
    break
  else:
    if len(prime_factorize(co[i])) == 1 or len(prime_factorize(co[i])) == 2:
      ans += 1
print(ans)



Fixed submission:
x, y  = map(int, input().split())
 
def prime_factorize(n):
    a = [1]
    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
  
prime_x = prime_factorize(x)
prime_y = prime_factorize(y)
 
num_x = len(prime_x)
num_y = len(prime_y)
 
num = min(num_x, num_y)
co = list(set(prime_x) & set(prime_y))

ans = 0
for i in range(len(co)):
  if co == [1]:
    ans = 1
    break
  else:
    if len(prime_factorize(co[i])) == 1 or len(prime_factorize(co[i])) == 2:
      ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
nocounter = 0
n = len(s)

for i in range(n):
  if (i % 2 == 0):
    if s[i] == "L":
      print("No")
      nocounter = 1
      break
  if (i % 2 == 1):
    if s[i] == "R":
      print("No"):
      nocounter = 1
      break
      
if (nocounter = 0):
  print("Yes")

Fixed submission:
s = input()
nocounter = 0
n = len(s)
 
for i in range(n):
  if (i % 2 == 0):
    if s[i] == "L":
      print("No")
      nocounter = 1
      break
  if (i % 2 == 1):
    if s[i] == "R":
      print("No")
      nocounter = 1
      break
      
if (nocounter == 0):
  print("Yes")
Buggy python submission (verdict: Runtime Error):
n,k,q = map(int, input().split())

scores = []

for i in range(n):
  scores.append(n-k)

for i in range(q):
  a = int(input()) #Ai
  scores.insert(a-1, scores[a-1]+1)
  
  
for i in range(n):
  if(scores[i] > 0):
    print("Yes")
  elif:
    print("No")

Fixed submission:
n,k,q = map(int, input().split())
 
scores = []
 
for i in range(n):
  scores.append(k-q)
 
for i in range(q):
  a = int(input()) #Ai
  scores[a-1] = scores[a-1]+1
  
for i in range(n):
  if(scores[i] > 0):
    print("Yes")
  else:
    print("No")

Buggy python submission (verdict: Runtime Error):
n , k , q = map(int,input().split())

scores = []
def decrease(n):
  return n-1

for i in range(q):
  scores.append(k)

for i in range(n):
  a = int(input()) # Ai
  scores = map(decrease, scores) # -1 to all 
  scores[a-1] += 1

for i in range(n):
  if scores[i] > 0:
    print("Yes")
  else:
    print("No")

Fixed submission:
n,k,q = map(int, input().split())
 
scores = []
 
for i in range(n):
  scores.append(k-q)
 
for i in range(q):
  a = int(input()) #Ai
  scores[a-1] = scores[a-1]+1
  
for i in range(n):
  if(scores[i] > 0):
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())

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

for i in range(m):
  prices.sort()
  prices[n-1] = prices[n-1] // 2
  
print(sum(prices))
	

    

Fixed submission:
import heapq

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

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

q = []

for a in A:
    heapq.heappush(q, -a)

for i in range(m):
    a = heapq.heappop(q)
    a = -(-a // 2)
    heapq.heappush(q, a)

print(-sum(q))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split())) # taberu order
b = list(map(int, input().split())) # get
c = list(map(int, input().split())) # renzoku

ans = 0
for i in range(n):
  po = a[i]
  ans += b[po]

for i in range(n-1):
  if(a[i] + 1 = a[i+1] ):
    ans += c[i]
    
print(ans)



Fixed submission:
n = int(input())
a = list(map(int, input().split())) # taberu order
b = list(map(int, input().split())) # get
c = list(map(int, input().split())) # renzoku
 
ans = 0
for i in range(n):
  po = a[i]
  ans += b[po-1]
 
for i in range(n-1):
  if(a[i] + 1 == a[i+1] ):
    ans += c[a[i]-1]
    
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())

b = list(map(int, input().split()))
a = []
a.append(b[0])
for i in range(0,n):
  a.append(b[i])
  
for i in range(n):
  if(a[i] > a[i+1]):
    a[i] = a[i+1]
    
sum = 0
for i in range(n):
  sum += a[i]
  
print(sum)

Fixed submission:
n = int(input())
 
b = list(map(int, input().split()))
a = []
a.append(b[0])
for i in range(0,n-1):
  a.append(b[i])

for i in range(n-1):
  if(a[i] > a[i+1]):
    a[i] = a[i+1]
    
sum = 0
for i in range(n):
  sum += a[i]
  
print(sum)