Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[int(input()) for i in range(n)]
A,B=sorted(a,reverse=True)[0:2]
for i in range(n):
    if i==a.index(max(a)):
        print(B)
    else:
        print(A)

Fixed submission:
n=int(input())
a=[int(input()) for i in range(n)]
A,B=sorted(a,reverse=True)[0:2]
for i in range(n):
    if a[i]==A:
        print(B)
    else:
        print(A)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[]
for i in range(n):
    a.append(int(input()))
for i in range(n):
    if i==a.index(max(a)):
        print(max(a[:i]+a[i+1:]))
    else:
        print(max(a))

Fixed submission:
n=int(input())
a=[int(input()) for i in range(n)]
A,B=sorted(a,reverse=True)[0:2]
for i in range(n):
    if a[i]==A:
        print(B)
    else:
        print(A)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[]
for i in range(n):
    a.append(int(input()))
for i in range(n):
    cura=a[:i]+a[i+1:]
    print(max(cura))

Fixed submission:
n=int(input())
a=[int(input()) for i in range(n)]
A,B=sorted(a,reverse=True)[0:2]
for i in range(n):
    if a[i]==A:
        print(B)
    else:
        print(A)
Buggy python submission (verdict: Time Limit Exceeded):
n,a,b=map(int,input().split())
s=input()
passed=0
oversea=[]
yep=False
cnt=0
for i in range(n):
    if s[i]=="b":
        oversea.append(i)
for i in range(n):
    if s[i]=="c":
        print("No")
    elif s[i]=="a":
        if passed<(a+b):
            print("Yes")
            passed+=1
        else:
            print("No")
    else:
        if oversea.index(i)<b and passed<(a+b):
            print("Yes")
            passed+=1
        else:
            print("No")
    if passed>=(a+b):
        yep=True
        cnt=len(s)-(i+1)
        break
if yep:
    for i in range(cnt):
        print("No")

Fixed submission:
n,a,b=map(int,input().split())
s=input()
passed=0
oversea=0
yep=False
cnt=0
for i in range(n):
    if s[i]=="c":
        print("No")
    elif s[i]=="a":
        if passed<(a+b):
            print("Yes")
            passed+=1
        else:
            print("No")
    else:
        if oversea<b and passed<(a+b):
            print("Yes")
            passed+=1
            oversea+=1
        else:
            print("No")
#     if passed>=(a+b):
#         yep=True
#         cnt=len(s)-(i+1)
#         break
# if yep:
#     for i in range(cnt):
#         print("No")

Buggy python submission (verdict: Time Limit Exceeded):
n,a,b=map(int,input().split())
s=input()
passed=0
oversea=[]
for i in range(n):
    if s[i]=="b":
        oversea.append(i)
for i in range(n):
    if s[i]=="c":
        print("No")
    elif s[i]=="a":
        if passed<(a+b):
            print("Yes")
            passed+=1
        else:
            print("No")
    else:
        if oversea.index(i)<b and passed<(a+b):
            print("Yes")
            passed+=1
        else:
            print("No")
    

Fixed submission:
n,a,b=map(int,input().split())
s=input()
passed=0
oversea=0
yep=False
cnt=0
for i in range(n):
    if s[i]=="c":
        print("No")
    elif s[i]=="a":
        if passed<(a+b):
            print("Yes")
            passed+=1
        else:
            print("No")
    else:
        if oversea<b and passed<(a+b):
            print("Yes")
            passed+=1
            oversea+=1
        else:
            print("No")
#     if passed>=(a+b):
#         yep=True
#         cnt=len(s)-(i+1)
#         break
# if yep:
#     for i in range(cnt):
#         print("No")
Buggy python submission (verdict: Runtime Error):
alph=input()
if(alpha.isupper()):
  print("A")
else:
  print("a")

Fixed submission:
alpha=input()
if(alpha.isupper()):
  print("A")
else:
  print("a")
Buggy python submission (verdict: Runtime Error):
 x, y = map(int, input().split())
if y%2 == 0 and (x*2 <= y <= x*4):
  print('Yes')
else:
  print('No')

Fixed submission:
x, y = map(int, input().split())
if y%2 == 0 and (x*2 <= y) and (y<= x*4):
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):


n=int(input())
l=list(map(int,input().split()))
res=1
f=1
for x in l:
    res=res*x
    if(res>1000000000000000000):
        
        f=0
    else:
        f=1
if(f==1):
    print(res)
else:
    print(-1)
    
        
    
    


Fixed submission:


n=int(input())
l=list(map(int,input().split()))
res=1
f=1
if(0 in l):
    print(0)
    f=0
if(f==1):
    
    for x in l:
        res=res*x
        if(res>1000000000000000000):
            print(-1)    
            f=0
            break
    
    if(f==1):
        print(res)
Buggy python submission (verdict: Runtime Error):
s=input()
t=input()
a=int(input())
b=int(input())
u=input()
if(u==s):
    print(a-1,b)
elif(u==t):
    print(a,b-1)
    


Fixed submission:
s,t=input().split()
a,b=map(int,input().split())
u=input()
if(u==s):
    print(a-1,b)
elif(u==t):
    print(a,b-1)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
ans=1
limit=10**18
for x in A:
  ans=ans*x

if ans > 10**18:
  print(-1)
else:
  print(ans)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
ans=1
limit=10**18
flag=True
for x in A:
  if x==0:
    flag=False
    ans=0
if flag:
  for x in A:
    ans=ans*x
    if ans > limit:
      ans=-1
      break
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
A,B,C,K = map(int,input().split())
rank=0
ans = 0
for i in range(K):
  if i<A:
    ans+=1
  elif A<=i and i<A+B:
    continue
  else:
    ans-=1
print(ans)

Fixed submission:
A,B,C,K = map(int,input().split())
rank=0
ans = 0
if K<=A:
  print(K)
elif A+B>=K and K>A:
  print(A)
else:
  tem=K-A-B
  ans=A-tem
  print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
a = list(map(int, input().split()))

visited = []
pos = 0
count = 0

while pos not in visited:
	visited.append(pos)
	pos = a[pos]-1
	count += 1
	if count >= k:
		print(pos+1)
		exit()

loop_start = visited.index(pos)
loop_length = len(visited)-loop_start
pos_t = (k-loop_start) % loop_length + loop_start
print(visited[pos_t]+1)

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

visited = []
tf_visited = [0] * n
pos = 0
count = 0

while tf_visited[pos] == 0:
	visited.append(pos)
	tf_visited[pos] = 1
	pos = a[pos]-1
	count += 1
	if count >= k:
		print(pos+1)
		exit()

loop_start = visited.index(pos)
loop_length = len(visited)-loop_start
pos_t = (k-loop_start) % loop_length + loop_start
print(visited[pos_t]+1)
Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce

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

def gcd(x,y):
	x_ = max(x,y)
	y_ = min(x,y)
	if y_==0:
		return 0
	if x_%y_==0:
		return y_
	return gcd(y_, x_%y_)

def gcd_list(numbers):
	return reduce(gcd, numbers)

gcds = [gcd_list(a[:i]+a[i+1:]) for i in range(n)]

print(max(gcds))


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

def gcd(x_,y_):
	x = max(x_, y_)
	y = min(x_, y_)
	if y==0:
		return x
	if x%y == 0:
		return y
	return gcd(y, x%y)

L = [0]*n
R = [0]*n
L[0] = a[0]
R[-1] = a[-1]

for i in range(1,n):
	L[i] = gcd(L[i-1], a[i])
	j = n-1-i
	R[j] = gcd(R[j+1], a[j])

L = [0]+L
R = R + [0]
M = [0]*n
for i in range(n):
	M[i] = gcd(L[i],R[i+1])
print(max(M))

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

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

def gcd_list(numbers):
	return reduce(math.gcd, numbers)

gcds = [gcd_list(a[:i]+a[i+1:]) for i in range(n)]

print(max(gcds))


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

def gcd(x_,y_):
	x = max(x_, y_)
	y = min(x_, y_)
	if y==0:
		return x
	if x%y == 0:
		return y
	return gcd(y, x%y)

L = [0]*n
R = [0]*n
L[0] = a[0]
R[-1] = a[-1]

for i in range(1,n):
	L[i] = gcd(L[i-1], a[i])
	j = n-1-i
	R[j] = gcd(R[j+1], a[j])

L = [0]+L
R = R + [0]
M = [0]*n
for i in range(n):
	M[i] = gcd(L[i],R[i+1])
print(max(M))
Buggy python submission (verdict: Runtime Error):
a,b,k = map(int, input().split())
cnt = 0
for i in range(min(a,b),-1,0):
  if a%i == 0 and b%i == 0:
    cnt += 1
  if cnt>=k:
    print(i)
    exit()

Fixed submission:
a,b,k = map(int, input().split())
mn = min(a,b)
cnt = 0
for i in range(mn, 0, -1):
    if a%i==0 and b%i==0:
        cnt += 1
    if cnt >= k:
        print(i)
        exit()
Buggy python submission (verdict: Runtime Error):
if n>=2*k-1:
  print('YES')
else:
  print('NO')

Fixed submission:
n, k = map(int, input().split())
if n>=2*k-1:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
import numpy as np

n, k = map(int, input().split())
mx = {}
for _ in range(n):
    t, d  = map(int, input().split())
    if t not in mx:
        mx[t] = d
    elif mx[t] < d:
        mx[t] = d
    sushi.append((t,d))

# 美味しさでソート
taste_sorted_sushi = sorted(sushi, key=lambda x:x[1], reverse=True)

# 貪欲にK個選び分割する
selected_sushi = taste_sorted_sushi[:k]

# 貪欲なK個の種類の分布を調べる
# K個の中で二つ以上あるものとそうでないものに分ける
S = set()
q = []
for s in selected_sushi:
    if s[0] in S:
        q.append(s)
    else:
        S.add(s[0])

q = sorted(q, key=lambda x:x[1], reverse=True)
ans = sum(selected_sushi[:][1])+len(S)**2

S = set(selected_sushi[:][0])
for i in range(k,n):
    if taste_sorted_sushi[k] not in S:
        ans = max(ans, ans-q.pop()+taste_sorted_sushi[k]-len(S)**2 + (len(S)+1)**2
        S.add(taste_sorted_sushi[k][0])

print(ans)

Fixed submission:
import numpy as np

n, k = map(int, input().split())
mx = {}
sushi = []
for _ in range(n):
    t, d  = map(int, input().split())
    if t not in mx:
        mx[t] = d
    elif mx[t] < d:
        mx[t] = d
    sushi.append([t,d])

# 美味しさでソート
taste_sorted_sushi = sorted(sushi, key=lambda x:x[1], reverse=True)

# 貪欲にK個選び分割する
selected_sushi = np.array(taste_sorted_sushi[:k], dtype=np.int64)

# 貪欲なK個の種類の分布を調べる
# K個の中で二つ以上あるものとそうでないものに分ける
S = set()
q = []
for s in selected_sushi:
    if s[0] in S:
        q.append(s[1])
    else:
        S.add(s[0])

q = sorted(q, reverse=True)
ans = sum(selected_sushi[:,1])+len(S)**2
tmp = ans

#print(selected_sushi, selected_sushi[:,1], 'ans', ans, S, q)

#print(S)
for i in range(k,n):
    if not q:
        break
    if taste_sorted_sushi[i][0] not in S:
        #print('ans',ans)
        #print('taste_sorted_sushi',taste_sorted_sushi[i])
        tmp = tmp-q.pop()+taste_sorted_sushi[i][1]-len(S)**2 + (len(S)+1)**2
        ans = max(ans, tmp)
        S.add(taste_sorted_sushi[i][0])

print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np

n, k = map(int, input().split())
h = np.array(list(map(int, input().split())))

cost = np.zeros(n)


for i in range(1,n):
    left = max(0,i-k)
    cost[i] = cost[left:i]+abs(h[i]-h[left:i]).min()
     

print(int(cost[-1]))


Fixed submission:
import numpy as np

n, k = map(int, input().split())
h = np.array(list(map(int, input().split())))

cost = np.zeros(n)


for i in range(1,n):
    left = max(0,i-k)
    cost[i] = (cost[left:i]+abs(h[i]-h[left:i])).min()
     

print(int(cost[-1]))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

n, k = map(int, input().split())
h = np.array(list(map(int, input().split())))

cost = np.zeros(n)


for i in range(1,n):
    left = max(0,i-k)
    cost[i] = min(cost[left:i]+abs(h[i]-h[left:i]))
     

print(int(cost[-1]))


Fixed submission:
import numpy as np

n, k = map(int, input().split())
h = np.array(list(map(int, input().split())))

cost = np.zeros(n)


for i in range(1,n):
    left = max(0,i-k)
    cost[i] = (cost[left:i]+abs(h[i]-h[left:i])).min()
     

print(int(cost[-1]))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

n, k = map(int, input().split())
h = np.array(list(map(int, input().split())))

cost = np.zeros(n)

for i in range(1,n):
    left = max(0,i-k)
    tmp = min(cost[left:i]+abs(h[i]-h[left:i]))
    cost[i] = tmp

print(int(cost[-1]))


Fixed submission:
import numpy as np

n, k = map(int, input().split())
h = np.array(list(map(int, input().split())))

cost = np.zeros(n)


for i in range(1,n):
    left = max(0,i-k)
    cost[i] = (cost[left:i]+abs(h[i]-h[left:i])).min()
     

print(int(cost[-1]))
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

n = int(input())

happiness = np.zeros(3)

for i in range(n):
    act = np.array(list(map(int, input().split())))
    happiness = np.maximum(act+np.roll(happiness, 1), act+np.roll(happiness, 2))

print(int(happiness.max()))

Fixed submission:
import numpy as np

n = int(input())

happiness = [0]*3

for i in range(n):
    act = list(map(int, input().split()))
    tmp1 = [happiness[(i+1)%3]+act[i] for i in range(3)]
    tmp2 = [happiness[(i+2)%3]+act[i] for i in range(3)]
    happiness = [max(tmp1[i], tmp2[i]) for i in range(3)]

print(max(happiness))
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n, p = map(int ,input().split())

m = int(np.floor(p**(1/n)))+1

for i in range(m,0,-1):
    if p%(i**n)==0:
        print(i)
        exit()

Fixed submission:
import numpy as np
n, p = map(int ,input().split())

def prime_decomposition(n):
    i = 2
    n0 = n
    primes = {}
    while i**2<n0:
        #print(i)
        if n%i==0:
            primes[i] = 0
        while n%i==0:
            n=n//i
            primes[i] += 1
        i += 1
    if n!=1:
        primes[n] = 1
    return primes

primes = prime_decomposition(p)
#print(primes)

ans = 1
for prime in primes:
    ans *= prime**(primes[prime]//n)

print(ans)
Buggy python submission (verdict: Runtime Error):
N, T = map(int, input().split())
c = []
t = []
for i in range(N):
    tmp1, tmp2 = map(int, input().split())
    c.append(tmp1)
    t.append(tmp2)

tmp_min = float('inf')

for i in range(N):
    if t[i]<=T and tmp_min>c[i]:
        tmp_min = c[i]

if tmp_min == float('inf'):
    print('TLE')
else tmp_min<=T:
    print(int(tmp_min))


Fixed submission:
n, t = map(int, input().split())
cmin = float("inf")
for i in range(n):
    ci, ti = map(int, input().split())
    if ti <= t and ci < cmin:
        cmin = ci
if cmin == float("inf"):
    print("TLE")
else:
    print(cmin)
Buggy python submission (verdict: Runtime Error):
n = int(input())
data = [tuple(map(int, input().split())) for _ in range(n)]
ax, ay, ah = list(filter(lambda x:x[2], data))[0]

for cx in range(101):
    for cy in range(101):
        H = h + abs(ax-cx) + abs(ay-cy)
        if all(max(H-abs(d[0]-cx)-abs(d[1]-cy),0)==d[2]) for d in data):
            print(cx, cy, H)
            exit()

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

for _ in range(n):
    x, y, h = map(int, input().split())
    data.append((x,y,h))

data.sort(key=lambda x:x[2], reverse=True)

for cx in range(101):
    for cy in range(101):
        flg = False
        # print(cx, cy)
        tmp = None
        for k in data:
            x = k[0]
            y = k[1]
            h = k[2]
            if not tmp:
                tmp = h+abs(cx-x)+abs(cy-y)
                continue
            if h == 0 and tmp>abs(cx-x)+abs(cy-y):
                flg = True
                break
            elif h == 0:
                continue
            elif tmp == h+abs(cx-x)+abs(cy-y):
                continue
            else:
                flg = True 
                break
        if flg:
            continue
        else:
            print(cx, cy, tmp)
            exit()

Buggy python submission (verdict: Runtime Error):
n = int(input())
X = []
Y = []
H = []

for _ in range(n):
    x, y, h = map(int, input().split())
    X.append(x)
    Y.append(y)
    H.append(h)

for cx in range(101):
    for cy in range(101):
        flg = False
        # print(cx, cy)
        tmp = None
        for k in range(n):
            # print(tmp)
            if H[k] == 0 and tmp<abs(cx-X[k])+abs(cy-Y[k]):
                flg = True
                break
            elif H[k] == 0:
                continue
            elif not tmp:
                tmp = H[k]+abs(cx-X[k])+abs(cy-Y[k])
                continue
            elif tmp == H[k]+abs(cx-X[k])+abs(cy-Y[k]):
                continue
            else:
                flg = True 
                break
        if flg:
            continue
        else:
            print(cx, cy, tmp)
            exit()


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

for _ in range(n):
    x, y, h = map(int, input().split())
    data.append((x,y,h))

data.sort(key=lambda x:x[2], reverse=True)

for cx in range(101):
    for cy in range(101):
        flg = False
        # print(cx, cy)
        tmp = None
        for k in data:
            x = k[0]
            y = k[1]
            h = k[2]
            if not tmp:
                tmp = h+abs(cx-x)+abs(cy-y)
                continue
            if h == 0 and tmp>abs(cx-x)+abs(cy-y):
                flg = True
                break
            elif h == 0:
                continue
            elif tmp == h+abs(cx-x)+abs(cy-y):
                continue
            else:
                flg = True 
                break
        if flg:
            continue
        else:
            print(cx, cy, tmp)
            exit()
Buggy python submission (verdict: Runtime Error):
S=input()
T=input()

Rs = {}
Rt = {}
for i in range(len(S)):
    if S[i] in Rs.keys:
        if Rs[S[i]] != T[i]:
             print("No")
             exit()
    else:
        Rs[S[i]] = T[i]

    if T[i] in Rt.keys:
        if Rt[T[i]] != S[i]:
            print("No")
            exit()
    else:
        Rt[T[i]] = S[i]
print("Yes")


Fixed submission:
S=input()
T=input()

Rs = {}
Rt = {}
for i in range(len(S)):
    if S[i] in Rs.keys():
        if Rs[S[i]] != T[i]:
             print("No")
             exit()
    else:
        Rs[S[i]] = T[i]

    if T[i] in Rt.keys():
        if Rt[T[i]] != S[i]:
            print("No")
            exit()
    else:
        Rt[T[i]] = S[i]
print("Yes")

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
T = input()

def swap(s,c1,c2):
    a = "0"
    s = s.replace(c1,a)
    s = s.replace(c2,c1)
    s = s.replace(a,c2)
    return s

for i in range(len(S)):
    if S[i] == T[i]:
        continue
    else:
        S = swap(S,S[i],T[i])

if S == T:
    print("Yes")
else:
    print("No")


Fixed submission:
S=input()
T=input()

Rs = {}
Rt = {}
for i in range(len(S)):
    if S[i] in Rs.keys():
        if Rs[S[i]] != T[i]:
             print("No")
             exit()
    else:
        Rs[S[i]] = T[i]

    if T[i] in Rt.keys():
        if Rt[T[i]] != S[i]:
            print("No")
            exit()
    else:
        Rt[T[i]] = S[i]
print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
import math

n, m = map(int, input().split())
mod = 10**9+7

def prime_decomposition(n):
    p = 2
    prime = {}
    while n!=1:
        while n%p == 0:
            n = n//p
            if p not in prime:
                prime[p] = 0
            prime[p] += 1
        p += 1
    return prime

primes = prime_decomposition(m)
ans = 1

def combination(n,k):
    ret1 = 1
    ret2 = 1
    for i in range(k):
        ret1 *= n-i
        ret2 *= k-i
    return ret1//ret2

for pw in primes.values():
    comb = combination(pw+n-1, pw)
    ans *= comb
    ans %= mod

print(ans)


Fixed submission:
n, m = map(int, input().split())
mod = 10**9+7

def prime_decomposition(n):
    p = 2
    prime = {}
    while n!=1:
        while n%p == 0:
            n = n//p
            if p not in prime:
                prime[p] = 0
            prime[p] += 1
        p += 1
    return prime

primes = prime_decomposition(m)
# print(primes)
ans = 1

def combination(n,k):
    ret1 = 1
    ret2 = 1
    for i in range(k):
        ret1 *= n-i
        ret2 *= k-i
    return ret1//ret2

for pw in primes.values():
    comb = combination(pw+n-1, pw)
    ans *= comb
    ans %= mod

print(ans)

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

n, m = map(int, input().split())
mod = 10**9+7

def prime_decomposition(n):
    p = 2
    prime = {}
    while n!=1:
        while n%p == 0:
            n = n/p
            if p not in prime:
                prime[p] = 0
            prime[p] += 1
        p += 1
    return prime

primes = prime_decomposition(m)
# print(primes)
ans = 1

def combination(n,k):
    ret1 = 1
    ret2 = 1
    for i in range(k):
        ret1 *= n-i
        ret2 *= k-i
    return ret1//ret2

for p in primes:
    comb = combination(primes[p]+n-1, primes[p])
    ans *= comb
    ans %= mod

print(int(ans))


Fixed submission:
n, m = map(int, input().split())
mod = 10**9+7

def prime_decomposition(n):
    p = 2
    prime = {}
    while n!=1:
        while n%p == 0:
            n = n//p
            if p not in prime:
                prime[p] = 0
            prime[p] += 1
        p += 1
    return prime

primes = prime_decomposition(m)
# print(primes)
ans = 1

def combination(n,k):
    ret1 = 1
    ret2 = 1
    for i in range(k):
        ret1 *= n-i
        ret2 *= k-i
    return ret1//ret2

for pw in primes.values():
    comb = combination(pw+n-1, pw)
    ans *= comb
    ans %= mod

print(ans)
Buggy python submission (verdict: Runtime Error):
d, g = map(int, input().split())
p = []
c = []
for i in range(d):
    a,b = map(int, input().split())
    p.append(a)
    c.append(b)

def recursive_min(score, pi):
    # 点数と（残っている）問題の数に対してminの問題数を返す
    min = float('inf')
    for i in range(d):
        if pi[i] > 1:
            next_pi = pi[:]
            next_pi[i] += -1
            next_score = score-(i+1)*100
        elif pi[i] == 1:
            next_pi = pi[:]
            next_pi[i] += -1
            next_score = score-c[i]-(i+1)*100
        else:
            continue

        if next_score<=0:
            return 1
        cand_min = 1+recursive_min(next_score, next_pi)
        if cand_min<min:
            min = cand_min
    return min

print(recursive_min(g, p))


Fixed submission:
import numpy as np
d, g = map(int ,input().split())
points = [list(map(int,input().split())) for _ in range(d)]

def min_q(comp_flg, target_score): # comp_flag[i]=True以外の問題iについて、compポイントを無視してtarget_scoreを超えるには最低いくつの問題数が必要かを返す
    score = 0
    q_num = 0
    for i in range(d-1,-1,-1):
        if comp_flg[i]:
            continue
        if target_score>score+points[i][0]*(i+1)*100:
            score += points[i][0]*(i+1)*100
            q_num += points[i][0] 
        else:
            q_num += np.ceil((target_score-score)/(100*(i+1)))
            break
    return q_num


mn = float('inf')
for i in range(1<<d):
    complete_flg = [False]*d
    tmp_q_num = 0
    tmp_point = 0
    for j in range(d):
        if i&(2**j) != 0:
            tmp_point += points[j][0] * 100*(j+1) + points[j][1]
            complete_flg[j] = True
            tmp_q_num += points[j][0]
    if tmp_point < g:
        tmp_q_num += min_q(complete_flg, g-tmp_point)
    if mn>tmp_q_num:
        mn = tmp_q_num

print(int(mn))
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input())
if (a*b)%2 == 0:
    print("Even")
else:
    print("Odd")

Fixed submission:
a, b = map(int, input().split())
if (a*b)%2 == 0:
    print("Even")
else:
    print("Odd")
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())

for i in range(n+1):
    if a <= sum(list(map(int, list(str(i))))) <= b:
        ans += i

print(ans)

Fixed submission:
n, a, b = map(int, input().split())
sum = 0
for i in range(n+1):
    isum = 0
    m = i
    while m != 0:
        isum += m%10
        m = m//10
    if isum >= a and isum <= b:
        sum += i
print(sum)
Buggy python submission (verdict: Runtime Error):
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1")-1)
print(ans)

Fixed submission:
print(input().count("1"))

Buggy python submission (verdict: Runtime Error):
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(a) - bin(a).rfind("1")-1)
print(ans)


Fixed submission:
print(input().count("1"))