Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
print(4 if n >= 189 else 3 if n >= 165 else if 2 if n >= 135 else 1 if n >= 105 else 0)

Fixed submission:
print((lambda x:(x[0]-1)*(x[1]-1))(list(map(int,input().split()))))

Buggy python submission (verdict: Runtime Error):
n = int(input())
print(4 if n >= 189 else 3 if n >= 165 else 2 if n >=n 135 else 1 if n >= 105 else 0)

Fixed submission:
print((lambda x:(x[0]-1)*(x[1]-1))(list(map(int,input().split()))))
Buggy python submission (verdict: Runtime Error):
# a*b*c : 105, 165
# a^3*b : 135, 189

n = int(input())
print(4 if n >= 189 else 3 if n >= 165 else if 2 if n >=n 135 else 1 if n >= 105 else 0)

Fixed submission:
k = [104,134,164,188,194]
n = int(input())
k.append(n)
print(sorted(k).index(n))
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
import functools

def inp():
  return list(map(int, input().split()))

N,C = inp()
D = [[0] * (C+1)]
c = [[], [], []]
for i in range(C):
  D.append([0] + inp())
for i in range(N):
  l = inp()
  for j in range(N):
    c[(i+j)%3].append(l[j])

# print(N,C,D,c)

sc = list(itertools.permutations(list(range(1,C+1)), 3))
# print(sc)

ret = []
for sc_i in sc:
  ret.append(0)
  for i in range(3):    
    ret[-1] += (sum(list(map(lambda x: D[x][sc_i[i]], c[i]))))
  #print(ret[-1])

print(min(ret))

Fixed submission:
import itertools
import functools

def inp():
  return list(map(int, input().split()))

N,C = inp()
D = [[0] * (C+1)]
c = [[], [], []]
for i in range(C):
  D.append([0] + inp())
for i in range(N):
  l = inp()
  for j in range(N):
    c[(i+j)%3].append(l[j])

# print(N,C,D,c)

sc = list(itertools.permutations(list(range(1,C+1)), 3))
# print(sc)

ret = []
for i in range(3):
  ret.append([])
  for j in range(1,C+1):    
    ret[-1].append(sum(list(map(lambda x: D[x][j], c[i]))))
#  print(ret[-1])

ans = []
for sc_i in sc:
  ans.append(0)
  for i in range(3):
    ans[-1] += ret[i][sc_i[i]-1]
#  print(ans[-1])

print(min(ans))
Buggy python submission (verdict: Time Limit Exceeded):
import re

def xor(x,y):
  x = int(bin(x)[2:]) if type(x) == int else int(x)
  y = int(bin(y)[2:]) if type(x) == int else int(y)
  ret = re.sub("2", "0", str(x+y))
  return ret
  
input()
s = list(map(int, input().split()))

ans = 0
r = 0
x = 0
y = 0
for i in range(len(s)):
  ans += r - i
  for j in range(r, len(s)):
    x = x + s[j]
    y = xor(y, s[j])
    if bin(x) == "0b"+y:
      ans += 1
      r += 1
    else:
      break
  x = x - s[i] - s[j]
  y = xor(y, s[i])
  y = xor(y, s[j])

print(ans)

Fixed submission:
def xor(x,y):
  return str(int(x)+y).replace("2", "0")
  
input()
s = list(map(int, input().split()))
t = list(map(lambda x: int(bin(x)[2:]), s))

ans = 0
r = 0
x = 0
y = "0"
for i in range(len(s)):
  ans += r - i
  for j in range(r, len(s)):
    nx = x + s[j]
    ny = xor(y, t[j])
    if bin(nx)[2:] == ny:
      ans += 1
      r += 1
      x = nx
      y = ny
    else:
      break
  x = x - s[i]
  y = xor(y, t[i])

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
input()
s = list(map(int, input().split()))
#print(s)

ans = len(s)
for i in range(len(s)):
  x = s[i]
  y = x
  for j in range(i+1, len(s)):
    x = x + s[j]
    y = y ^ s[j]
    if x == y:
     ans += 1
    else:
      break

print(ans)

Fixed submission:
def xor(x,y):
  return str(int(x)+y).replace("2", "0")
  
input()
s = list(map(int, input().split()))
t = list(map(lambda x: int(bin(x)[2:]), s))

ans = 0
r = 0
x = 0
y = "0"
for i in range(len(s)):
  ans += r - i
  for j in range(r, len(s)):
    nx = x + s[j]
    ny = xor(y, t[j])
    if bin(nx)[2:] == ny:
      ans += 1
      r += 1
      x = nx
      y = ny
    else:
      break
  x = x - s[i]
  y = xor(y, t[i])

print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
r = []
for i in range(1,6):
  for j in range(len(s)-i):
    r.append(s[j:j+i])
print(sorted((set(r)))[int(input())-1])

Fixed submission:
s = input()
r = []
for i in range(1,6):
  for j in range(len(s)-i+1):
    r.append(s[j:j+i])
print(sorted((set(r)))[int(input())-1])
Buggy python submission (verdict: Runtime Error):
a,b=input().split();print(a if a=>b else int(a)-1)

Fixed submission:
a,b=input().split();print(a if b>=a else int(a)-1)
Buggy python submission (verdict: Runtime Error):
N = int(input())
p = list(map(int,input().split()))
ret = 0
flag = 0
for i in range(len(p)):
  if i + 1 == p[i]:
    if flag == 0:
      ret += 1
      if p[i+1] == i+2:
        flag = 1
    else:
      flag = 0
print(ret)

Fixed submission:
N = int(input())
p = list(map(int,input().split()))
ret = 0
flag = 0
for i in range(len(p)):
  if i + 1 == p[i]:
    if flag == 0:
      ret += 1
      if i < len(p)-1 and p[i+1] == i+2:
        flag = 1
    else:
      flag = 0
print(ret)
Buggy python submission (verdict: Runtime Error):
print(delta x: A if x[0]>x[1] else B, list(map(int,input().split())))

Fixed submission:
import math
x,a,b = list(map(int, input().split()))
print('A' if math.fabs(x-a) < math.fabs(x-b) else 'B')
Buggy python submission (verdict: Runtime Error):
h,w = sorted(list(map(int,input().split())))
if h % 3 == 0 or w % 3 == 0:
  ret = 0
else:
  c1 = ((w//3+1)*h)-((w-1-w//3)*(h//2)
  c2 = ((w-w//3)*(h-h//2))-(w//3*h)
  c3 = ((w-w//3)*(h-h//2))-((w-w//3)*(h//2))
  ret = min(c1,c2,c3)
print(ret)


Fixed submission:
h,w = sorted(list(map(int,input().split())))
if h % 3 == 0 or w % 3 == 0:
  ret = 0
else:
  c1 = ((w//3+1)*h)-((w-1-w//3)*(h//2))
  c2 = ((w-w//3)*(h-h//2))-(w//3*h)
  c3 = h
  c4 = ((h//3+1)*w)-((h-1-h//3)*(w//2))
  c5 = ((h-h//3)*(w-w//2))-(h//3*w)
  ret = min(c1,c2,c3,c4,c5)
print(ret)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
l = [0]*n
for i in range(0,m):
  for j in list(map(int,input().split())):
    l[j-1]+=1
for i in range(0,n):
  print(l[i])

Fixed submission:
print('Yes') if list(map(lambda a: a[0]<=a[2] and  a[2] <= a[1], [list(map(int,input().split()))]))[0] else print('No')
Buggy python submission (verdict: Time Limit Exceeded):
input()
a = list(map(int, input().split()))
c = []
b = [i for i in a if i in c or c.append(i)]
print(len(c) if len(b) % 2 == 0 else len(c)-1)

Fixed submission:
input()
a = list(map(int, input().split()))
c = {}
lb = lc = 0
for i in a:
  try:
    c[i] += 1
    lb += 1
  except:
    c[i] = 1
    lc += 1
print(lc if lb % 2 == 0 else lc-1)
Buggy python submission (verdict: Runtime Error):
input()
A=list(map(int,input().split()))
d,c,s=0,0,A[0]
for x in A[1:]:
 if x-s<d:
  d,c=x-s,c
 elif x-s==d:
  c+=1
 s=min(s,x)
print(c)

Fixed submission:
print((lambda x:"Yes" if max(x)*2==sum(x) else "No")(list(map(int,input().split()))))
Buggy python submission (verdict: Time Limit Exceeded):
raw_input('').split()
A = [int(x) for x in raw_input('').split()]
max = 0
msp = A[0]
for i in range(0,len(A)-1):
  if msp <= A[i]:
    continue
  else:
    msp = A[i]
    for j in range(i+1,len(A)):
        pf_t = A[j] - A[i]
        if pf_t > max:
          max = pf_t
          spot = [(i,j)]
        elif pf_t == max:
          spot.append((i,j))
print len(spot)

Fixed submission:
raw_input('').split()
A = [int(x) for x in raw_input('').split()]
max = 0
count = 0
pl = 0
msp = A[0]
for i in range(1,len(A)):
  pl_t = pl + A[i] - A[i-1]
  if pl_t <= 0:
    pl = 0
  else:
    pl = pl_t
    if max < pl_t:
      max = pl_t
      count = 1
    elif max == pl_t:
      count += 1
print count

Buggy python submission (verdict: Time Limit Exceeded):
N,T = [int(x) for x in raw_input('').split()]
A = [int(x) for x in raw_input('').split()]
max = 0
for i in range(0,len(A)):
  for j in range(i+1,len(A)):
      pf_t = A[j] - A[i]
      if pf_t > max:
        max = pf_t
        spot = [(i,j)]
      elif pf_t == max:
        spot.append((i,j))
print len(spot)

Fixed submission:
raw_input('').split()
A = [int(x) for x in raw_input('').split()]
max = 0
count = 0
pl = 0
msp = A[0]
for i in range(1,len(A)):
  pl_t = pl + A[i] - A[i-1]
  if pl_t <= 0:
    pl = 0
  else:
    pl = pl_t
    if max < pl_t:
      max = pl_t
      count = 1
    elif max == pl_t:
      count += 1
print count
Buggy python submission (verdict: Runtime Error):
from math import floor

X = int(input())
D = 100
for i in range(1, X+2):
    if D == X:
        print(i-1)
        break
    D = floor(D * (101/100))

Fixed submission:
X = int(input())
A = 100
i = 1
while True:
    A = int(A*1.01)
    if A >= X:
        print(i)
        break
    else:
        i += 1
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
T = []
for i in range(1, N+1):
    j = A.count(i)
    T.append(j)
for i in T:
    print(i)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
T = {}
for i in A:
    if i not in T:
        T[i] = 0
    T[i] = T[i] + 1
for i in range(1, N+1):
    print(T.get(i, 0))
Buggy python submission (verdict: Runtime Error):
N = input()
a = 0
for i in range(1, N + 1):
    if i % 5 != 0 and i % 3 != 0:
        a += i
print(a)

Fixed submission:
n = int(input())
a = 0
for i in range(1, n + 1):
    if i % 5 != 0 and i % 3 != 0:
        a += i
print(a)
Buggy python submission (verdict: Runtime Error):
K, N = map(int, input().split())
A = list(map(int, input().split())
distances = {}
for i in range(1, N):
	distances += (A[i] - A[i - 1]
most = max(distances.keys())
distances += (A[0] + K) - A[-1]                   
output = K - most
print(output)

Fixed submission:
K, N = map(int, input().split())
A = list(map(int, input().split()))

distance = []
for i in range(1, N):
	distance.append(A[i] - A[i - 1])
distance.append((A[0] + K - (A[-1])))
most = max(distance)
output = K - most
print(output)

Buggy python submission (verdict: Runtime Error):
K, N = map(int, input().split())
A = list(map(int, input().split())
distances = {}
for i in range(1, len(A)):
	distances += (A[i] - A[i - 1]
most = max(distances.keys())
distance += (A[0] + K) - A[-1]                   
output = K - most
print(output)

Fixed submission:
K, N = map(int, input().split())
A = list(map(int, input().split()))

distance = []
for i in range(1, N):
	distance.append(A[i] - A[i - 1])
distance.append((A[0] + K - (A[-1])))
most = max(distance)
output = K - most
print(output)

Buggy python submission (verdict: Runtime Error):
K, N = map(int, input().split())
A = list(map(int, input().split())
distances = {}
for i in range(1, len(A) + 1):
	distances += (A[i] - A[i - 1]
most = max(distances.keys())
output = K - most
print(output)

Fixed submission:
K, N = map(int, input().split())
A = list(map(int, input().split()))

distance = []
for i in range(1, N):
	distance.append(A[i] - A[i - 1])
distance.append((A[0] + K - (A[-1])))
most = max(distance)
output = K - most
print(output)

Buggy python submission (verdict: Runtime Error):
K, N = map(int, input().split())
A = list(map(int, input().split())
distances = {}
for i in range(1, len(A) + 1):
	distances += (A[i] - A[i - 1]
most = max(distances.keys())
output = K - most
                  print(output)

Fixed submission:
K, N = map(int, input().split())
A = list(map(int, input().split()))

distance = []
for i in range(1, N):
	distance.append(A[i] - A[i - 1])
distance.append((A[0] + K - (A[-1])))
most = max(distance)
output = K - most
print(output)
Buggy python submission (verdict: Runtime Error):
A,B = map(int.input().split())
print(A*B)

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

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

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

Buggy python submission (verdict: Runtime Error):
print(A * B)

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

Buggy python submission (verdict: Runtime Error):
A = input()
B = input()
if 1 <= A <= 100 and 1 <= B <= 100:
  print(A*B)

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

Buggy python submission (verdict: Runtime Error):
A = input()
B = input()
if 1 <= A and B <= 100
	print(A * B)

Fixed submission:
a,b = map(int,input(). split ())
print(a*b)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
a, b = input().split()
b_arr = b.split('.')
print(int(a)*(int(b_arr[0])+*int(b_arr[1])//100))

Fixed submission:
# -*- coding: utf-8 -*-
a, b = input().split()
print(int(a)*int(b.replace('.', ''))//100)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import math
a_n = map(int, input().split())
res = 1 * a for a in a_n
for a in a_n:
  res  *= a

res = -1 if math.log10(res) > 18 else res
print(res)

Fixed submission:
# -*- coding: utf-8 -*-
a, b = input().split()
print(int(a)*int(b.replace('.', ''))//100)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = []
b = []
for i in range(n):
	a_1, b_1 = input().split()
	a.append(int(a_1))
	b.append(int(b_1))
a.sort()
b.sort()
is_odds = n % 2 == 0
a_med = a[(n + 1) // 2 - 1] if not is_odds else (a[n // 2 - 1] + a[n // 2]) / 2
b_med = b[(n + 1) // 2 - 1] if not is_odds else (b[n // 2 - 1] + b[n // 2]) / 2
from_a = a_med if not is_odds else int(a_med * 2)
to_b = b_med if not is_odds else int(b_med * 2)

print(len(list(range(from_a, to_b + 1))))

Fixed submission:
n = int(input())
a = []
b = []
for i in range(n):
	a_1, b_1 = input().split()
	a.append(int(a_1))
	b.append(int(b_1))
a.sort()
b.sort()
is_odds = n % 2 == 0
a_med = a[(n + 1) // 2 - 1] if not is_odds else (a[n // 2 - 1] + a[n // 2]) / 2
b_med = b[(n + 1) // 2 - 1] if not is_odds else (b[n // 2 - 1] + b[n // 2]) / 2
from_a = a_med if not is_odds else int(a_med * 2)
to_b = b_med if not is_odds else int(b_med * 2)
print(to_b - from_a + 1)
Buggy python submission (verdict: Runtime Error):
import sys
 
args = sys.argv
 
sum = int(args[1])+int(args[2])+int(args[3])

if sum > 21:
	print('bust')
else:
	print('win')


Fixed submission:
A1,A2,A3=map(int,input().split())
if A1 + A2 + A3 > 21:
	print("bust")
else:
	print("win")

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

args = sys.argv

sum = int(args[0])+int(args[1])+int(args[2])

if sum > 21:
	print(bust)
else:
	print('win')

Fixed submission:
A1,A2,A3=map(int,input().split())
if A1 + A2 + A3 > 21:
	print("bust")
else:
	print("win")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
lst = list(map(int,input().split()))
res = 1
for i in lst:
    res *= i
if res > 1000000000000000000:
    print(-1)
else:
    print(res)


Fixed submission:
def cal():
    n = int(input())
    lst = list(map(int,input().split()))
    if 0 in lst:
    	return 0
    else:
        prod = 1
        for a in lst:
            prod *= a
            if prod > 1000000000000000000:
                return -1
    return prod
print(cal())

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
lst = list(map(int,input().split()))
res = 1
for i in lst:
    res *= i
if res > pow(10,18):
    print(-1)
else:
    print(res)


Fixed submission:
def cal():
    n = int(input())
    lst = list(map(int,input().split()))
    if 0 in lst:
    	return 0
    else:
        prod = 1
        for a in lst:
            prod *= a
            if prod > 1000000000000000000:
                return -1
    return prod
print(cal())
Buggy python submission (verdict: Runtime Error):
# 制約条件
MAX_RESULT = 1000000000000000000

N = int(input())
A1 = [int(x) for x in input().split()]

tmp = 1

for x in range(len(A1)):
    tmp = tmp * A1[x]

result = tmp

if (result > MAX_RESULT):
    result = -1

print(result)

Fixed submission:
a,b = map(int,input().split())
print(a*b)
Buggy python submission (verdict: Time Limit Exceeded):
# 制約条件
MAX_RESULT = 1000000000000000000

N = int(input())
A1 = [int(x) for x in input().split()]

tmp = 1

for x in range(len(A1)):
    tmp = tmp * A1[x]

result = tmp

if (result > MAX_RESULT):
    result = -1

print(result)

Fixed submission:
def main():
    # 制約条件
    MAX_RESULT = 1000000000000000000
    
    N = int(input())
    A = [int(x) for x in input().split()]
    
    if 0 in A:
        result = 0
        print(result)
        return
    
    result = 1
    
    for x in A:
        result *= x
        if result > MAX_RESULT:
            print(-1)
            return
    print(result)
main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = list(map(int, input().split()))
ans = 1
for i in l:
    ans *= i
if ans > 10**18:
    print(-1)
else:
    print(ans)


Fixed submission:
n = int(input())
l = list(map(int, input().split()))
ans = 1
for i in l:
    ans *= i
    ans = min(ans, 10**18 + 1)

if ans == 10**18 + 1:
    ans = -1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
b = list(map(int, input().split()))
x = 0

for i in range(n):
  if (i+1) in b:
    print(b.count(i+1))
  else:
    print(0)

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

c = collections.Counter(a)
for i in range(n):
  print(c[i+1])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
b = list(map(int, input().split()))
for i in range(n):
  print(b.count(i+1))

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

c = collections.Counter(a)
for i in range(n):
  print(c[i+1])
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = list(map(int, input().split()))
flag = True
for i in range(len(b)):
  if i%2==1:
    if b[i]%!=0 or b[i]%5!=0:
      flag = False
      
if flag == True:
  print("APPROVED")
else:
  print("DENIED")

Fixed submission:
a = int(input())
b = list(map(int, input().split()))
flag = True
for i in range(len(b)):
  if b[i]%2==0:
    if b[i]%3!=0 and b[i]%5!=0:
      flag = False
      
if flag == True:
  print("APPROVED")
else:
  print("DENIED")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
box = list(map(int, input().split()))

ans = 1
for i in range(len(box)):
  if i == 0: continue
  tibi = min(box[:i])
  if box[i] <= tibi:
    ans += 1
    
print(ans)

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

tibi = box[0]
ans = 1
for i in range(len(box)):
  if i == 0: continue
  if box[i] <= tibi:
    tibi = box[i]
    ans += 1
    
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b = list(map(int, input().split()))
if a*500>=b:
  print("Yes)
else:
  print("No")

Fixed submission:
a,b = list(map(int, input().split()))
if a*500>=b:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a, b, n = list(map(int, input().split()))

if (a + b) <= n:
  a = 0
  b = 0
else:
  if n > a:
    b -= n-a
    a = 0
    if b < 0:
      b = 0
  else:
    a = (n-a)

print("%d %d" %(a,b))

Fixed submission:
a, b = list(map(str, input().split()))
print(b+a)
Buggy python submission (verdict: Runtime Error):
a,b,n = list(map(int, input().split()))

if a+b<=n:
  a=0
  b=0
else:
  if n>a:
    b-=(n-a)
    a=0
    if b<0:
      b=0
  else:
    a=n-a

print("%d %d" %(a,b))

Fixed submission:
import math

def Is(x):
  flag = False
  i = 2
  while i < math.sqrt(x):
    if x % i==0:
      flag = True
      break
    i += 1
  return flag

a = int(input())
ans = 0
flag2 = True
i = 0
while flag2:
  flag2 = Is( a + i )
  ans = a + i
  i += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math

def Is(x):
  flag = False
  i = 2
  while i<math.sqrt(x):
    if x%i==0:
      flag = True
      break
      i+=1
  return flag

a = int(input())
ans = 0
flag2 = True
i = 0
while flag2:
  flag2 = Is(a+i)
  ans = a+i
  i+=1

print(ans)

Fixed submission:
import math

def Is(x):
  flag = False
  i = 2
  while i < math.sqrt(x):
    if x % i==0:
      flag = True
      break
    i += 1
  return flag

a = int(input())
ans = 0
flag2 = True
i = 0
while flag2:
  flag2 = Is( a + i )
  ans = a + i
  i += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
a = input()
b = 0
if a >= 82:
  print("No")
else:
  for i in range(9):
    for j in range(9):
      if (i+1)*(j+1)==a:
        print("Yes")
        b = 1
        break;
if b == 0:
  print("No")

Fixed submission:
a = int(input())
b = 0
if a<= 81:
  for i in range(9):
    for j in range(9):
      if (i+1)*(j+1)==a:
        b=1
        break
if b==0:
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
b = []
for i in range(a):
  if a%(i+1)==0:
    b.append(i+1)
wa = 100000000000
for i in range(len(b)):
    wa1 = b[i] + b[len(b)-i-1]
    if wa >= wa1:
      wa = wa1
if len(b)%2==1:
  wa1 = b[int(len(b)/2) + 1] * 2
  if wa >= wa1:
    wa = wa1
print(wa-2)

Fixed submission:
import math

def FindAllDivisors(x):
    divList = []
    y = 1
    while y <= math.sqrt(x):
        if x % y == 0:
            divList.append(y)
            divList.append(int(x / y))
        y += 1
    return divList

n = int(input())
a = FindAllDivisors(n)

b = 10000000000
for i in range(len(a)):
  if i%2==1:
    continue
  else:
    bb = a[i]+a[i+1]
    if b >= bb:
      b = bb

print(bb-2)
Buggy python submission (verdict: Runtime Error):
n = input()
k = input()
q = input()
a = [k-q for i in range(n)]

for i in range(q):
  b = input()
  a[b-1]++
  
for i in range(n):
  if a[i] > 0:
    print("Yes")
  else:
    print("No")

Fixed submission:
n,k,q = list(map(int, input().split()))
a = [k-q for i in range(n)]

for i in range(q):
  b = int(input())
  a[b-1] += 1
  
for i in range(n):
  if a[i] > 0:
    print("Yes")
  else:
    print("No")

Buggy python submission (verdict: Runtime Error):
N,K,Q=input()
c=[K-Q for i in range(N)]
for i in range(Q):
    A=input()
    c[A-1]++
for i in range(N):
    print("Yes" if c[i]>0 else "No")

Fixed submission:
n,k,q = list(map(int, input().split()))
a = [k-q for i in range(n)]

for i in range(q):
  b = int(input())
  a[b-1] += 1
  
for i in range(n):
  if a[i] > 0:
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n,a,b = map(int, input().split)
print(min(n*a,b))

Fixed submission:
n,a,b = map(int, input().split())
print(min(n*a,b))

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

if n*a <= b:
  print(n*a)
else:
  print(b)

Fixed submission:
n,a,b = map(int, input().split())
print(min(n*a,b))
Buggy python submission (verdict: Runtime Error):
n,y = list(map(int, input().split()))
a = 0
b = 0
c = 0
if 10000*(n-1)+5000 < y:
  print("-1 -1 -1")
else:
  for i in range(n+1):
    for j in range(n+1):
      for k in range(n+1):
        if 10000*i+5000*j+1000*k == y:
          a = i
          b = j
          c = k
          break
print("% % %" %(a, b, c))

Fixed submission:
n, y = map(int, input().split())
y //= 1000
D = y-n
for a in range(D//9 + 1):
  D2 = D-9*a
  if D2%4:
    continue
  else:
    b = D2//4
    if n-a-b >= 0:
      print(a, b, (n-a-b))
      exit()
print(-1,-1,-1)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
a = list(map(lambda x: int(x)-1, input().split()))
n = a[0]
his = [-1, n]
while True:
    n = a[n]
    if n in his:
        his.append(n)
        break
    his.append(n)
idx = his.index(his[-1])
loop = len(his[his.index(his[-1]):-1])
if len(his) > k:
    print(his[k]+1)
else:
    t = (k - idx) % loop
    g = his[idx:-1]
    print(g[t]+1)

Fixed submission:
s = input()
t = input()
if len(s) +1 != len(t):
    print('No')
    exit()
if s == t[:-1]:
    print('Yes')
    exit()
print('No')
Buggy python submission (verdict: Runtime Error):
import math
a, b, c =map(int, input().split())
r = (c - a - b)/2
l = a * b
if r <= 0:
    print('No')
    exit()
ans = l*l < r * r

print('Yes' if ans else 'No')


Fixed submission:
l =[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
i =int(input())
print(l[i-1])
Buggy python submission (verdict: Runtime Error):
n = int(input())
m = {}
for i in range(n):
    s = input()
    m[s] += 1

l = sorted(m.items, key=lambda x: x[1], reverse=True)
cnt = l[0][1]
p = []
for i in l:
    if i[1] == cnt:
        p.append(i[0])

p.sort()
for i in p:
  print(i)

Fixed submission:
n = int(input())
m = {}
for i in range(n):
    s = input()
    if s in m:
        m[s] += 1
    else:
        m[s] = 1

l = sorted(m.items(), key=lambda x: x[1], reverse=True)
cnt = l[0][1]
p = []
for i in l:
    if i[1] == cnt:
        p.append(i[0])

p.sort()
for i in p:
  print(i)