Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
num = list(map(int,input().split()))
for m in num:
  n = 1
  total = n * m
t = total % 2
if t == 0:
    print("Even")
  else:
    print("Odd")

Fixed submission:
num = list(map(int,input().split()))
a = num[0]
b = num[1]
c = (a * b) % 2
if c == 0:
  print("Even")
else:
  print("Odd")
Buggy python submission (verdict: Runtime Error):
s = input()
a = [int(c) for c in a]
total = sum(a)
print(total)

Fixed submission:
s = input()
a = [int(c) for c in s]
total = sum(a)
print(total)
Buggy python submission (verdict: Runtime Error):
a = int(input())
if 7 in a:
  print("Yes")
else:
  print("No")

Fixed submission:
a = [x for x in input()]
for i in range(len(a)):
    if a[i] == '7':
        a[i] = True
    else:
        a[i] = False
if any(a):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
import math
n = int(input())
a = list(map(int,input().split()))

ans = 10**18
prod = 1
f = 0
f2 = 0

for i in range(n):
    prod *= a[i]
    if a[i] == 0:
        f = 1
        break

if f == 1:
    print(0)

else:
    if prod > ans:
        print(-1)
    else:
        print(prod)
    

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

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

ans = 1000000000000000000
prod = 1
f = 0
f2 = 0

for i in range(n):
    if a[i] == 0:
        f = 1
        break

for i in range(n):
    prod = prod * a[i]

    if prod > ans:
        f2 = 1
        break

if f == 1:
    print(0)

else:
    if f2 == 1:
        print(-1)
    else:
        print(prod)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
import math
n = int(input())
a = list(map(int,input().split()))

ans = 10**18
prod = 1
for i in range(n):
    prod *= a[i]

if prod > ans:
    print(-1)
else:
    print(prod)

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

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

ans = 1000000000000000000
prod = 1
f = 0
f2 = 0

for i in range(n):
    if a[i] == 0:
        f = 1
        break

for i in range(n):
    prod = prod * a[i]

    if prod > ans:
        f2 = 1
        break

if f == 1:
    print(0)

else:
    if f2 == 1:
        print(-1)
    else:
        print(prod)
Buggy python submission (verdict: Runtime Error):
n = int(input())
test = []
for i in range(n):
    test.append(input())
print('AC x ' + str(test.count('AC')))
print('NA x ' + str(test.count('NA')))
print('TLE x ' + str(test.count('TLE')))
print('RE x ' + str(test.count('RE')))

Fixed submission:
n = int(input())
if n%1000 == 0:
    print(0)
else:
    print(1000 - n % 1000)

Buggy python submission (verdict: Runtime Error):
n = int(input())
test = []
for i in range(n):
    test.append(input())
print('AC x ' + str(test.count('AC')))
print('NA x ' + test.count('NA'))
print('TLE x ' + test.count('TLE'))
print('RE x ' + test.count('RE'))

Fixed submission:
n = int(input())
if n%1000 == 0:
    print(0)
else:
    print(1000 - n % 1000)
Buggy python submission (verdict: Runtime Error):
import math
a,b,h,m = map(int, input().split())
if h > 12:
    h_c = h-12
else:
    h_c = h
p_d = 6*(abs((h_c)*5 - m))
if p_d >= 180:
    p_d2 = 360 - p_d 
    d_2 = a**2 + b**2 - 2*a*b*math.cos(math.radians(p_d2))
    print(math.sqrt(d_2))
else:
    d_2 = a**2 + b**2 - 2*a*b*math.cos(math.radians(p_d))
    print(math.sqrt(d_2))

Fixed submission:
n = list(input())
n_1 = int(n[-1])
if n_1 == 3:
    print("bon")
elif n_1 == 0 or n_1 == 1 or n_1 == 6 or n_1 == 8:
    print("pon")
else:
    print("hon")
Buggy python submission (verdict: Runtime Error):
mport math
a,b,h,m = map(int, input().split())
if h > 12:
    h_c = h-12
p_d = 6*(abs(h*5 - m))
if p_d >= 180:
    p_d2 = 360 - p_d 
    d_2 = a**2 + b**2 - 2*a*b*math.cos(math.radians(p_d2))
    print(math.sqrt(d_2))
else:
    d_2 = a**2 + b**2 - 2*a*b*math.cos(math.radians(p_d))
    print(math.sqrt(d_2))

Fixed submission:
import math
a,b,h,m = map(int, input().split())
if h > 12:
    h_c = h-12
else:
    h_c = h
p_d = 6*(abs((h_c)*5+5*(m/60) - m)) #時針も分針の位置で一変わるんだった・・・
if p_d >= 180:
    p_d2 = 360 - p_d 
    d_2 = a**2 + b**2 - 2*a*b*math.cos(math.radians(p_d2))
    print(math.sqrt(d_2))
else:
    d_2 = a**2 + b**2 - 2*a*b*math.cos(math.radians(p_d))
    print(math.sqrt(d_2))
Buggy python submission (verdict: Runtime Error):
a, b, c, k = map(int, input().split())
if k <= a:
    k_pa, k_pb, k_pc = k , 0, 0 
elif k >= a and k-a <= b:
    k_pa, k_pb, k_pc = a, k-a, 0
elif k >= a and k-a >= b:
    k_pa, k_pb, k_pc = a, k-a, k-a-b
point = k_pa - (k-k_pa-k_pb)
print(point)

Fixed submission:
s = list(input())
t = list(input())
t.pop(-1)
print('Yes' if s == t else 'No')

Buggy python submission (verdict: Runtime Error):
a, b, c, k = map(int, input().split())
if k <= a:
    k_pa, k_pb, k_pc = k , 0, 0 
elif k >= a and k-a <= b:
    k_pa, k_pb, k_pc = a, k-a, 0
elif k >= a and k-a >= b:
    k_pa, k_pb, k_pc = a, k-a, k-a-b
point = k_pa - (k - k_pa - k_pb)
print(point)

Fixed submission:
s = list(input())
t = list(input())
t.pop(-1)
print('Yes' if s == t else 'No')
Buggy python submission (verdict: Runtime Error):
a, b, c, k = map(int, input().split())
if k <= a:
    k_pa, k_pb, k,pc = k , 0, 0 
elif k >= a and k-a <= b:
    k_pa, k_pb, k_pc = a, k-a, 0
elif k >= a and k-a >= b:
    k_pa, k_pb, k_pc = a, k-a, k-a-b
point = k_pa - (k-a-b)
print(point)

Fixed submission:
a, b, c, k = map(int, input().split())
if k <= a:
    k_pa, k_pb, k_pc = k , 0, 0 
elif k > a and k-a <= b:
    k_pa, k_pb, k_pc = a, b, 0
elif k > a and k-a > b:
    k_pa, k_pb, k_pc = a, b, k-a-b
point = k_pa - (k-k_pa-k_pb)
print(point)
Buggy python submission (verdict: Runtime Error):
s = list(input())
s_ = sorted(s)
t = list(input())
t_ = sorted(t,reverse=True)
print('Yes' if s_< t_ else 'No')

Fixed submission:
import math
a, b = input().split()
a = int(a)
b = int(b)
mean = (a + b) / 2
print(math.ceil(mean))
Buggy python submission (verdict: Time Limit Exceeded):
k,s = map(int, input().split())
cnt = 0
for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if x+y+z==s:
                cnt += 1
print(cnt)

Fixed submission:
k,s = map(int, input().split())
cnt = 0
for x in range(k+1):
    for y in range(k+1):
        z = s-x-y
        if 0<=z and z<=k : 
            cnt += 1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
for i in range(n):
  print(a.count(i+1))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
re=[0]*n
for i in a:
  re[i-1]+=1
for i in re:
  print(i)
Buggy python submission (verdict: Runtime Error):
#include<stdio.h>
int main() {
	char s[100], t[100];
	scanf("%s %s", s,t);
	for (int i = 0; i != '\0'; i++) {
		printf("%c", t[i]);
	}
	for (int j = 0; j != '\0'; j++) {
		printf("%c", s[j]);
	}
	
	return 0;
}

Fixed submission:
s,t=input().split()
print(t+s)
Buggy python submission (verdict: Runtime Error):
from sys import stdin
import numpy as np
input = stdin.readline

N = int(input())
A_list = list(map(int, input().split()))
ans_list =np.ones(N)
A_list = np.array(A_list)

for i in range(N):
    for j in range(i+1,N):
        if A_list[i] %  A_list[j] == 0:
            ans_list[i] = 0
            if (A_list[j] %  A_list[i] == 0):
                ans_list[j] = 0
        elif A_list[i] ==  A_list[j]:
                ans_list[i] = 0
                ans_list[j] = 0
        elif(A_list[j] %  A_list[i] == 0):
            ans_list[j] = 0
print(int(np.sum(ans_list)))

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

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

if n == 0:
    print (x)
    exit()

li = []
# res = float('inf')
# for i in n:
#      std = abs(x - p_list[i])
#      if std <= res:
#          res = std    
def dfslower(std) :
    """
    argument x : 基準となる数字
    y 結果となりうる数字？
    return : 結果
    """
    if std  in p_list:
        return dfslower(std-1)
        #print(std)
    else:
        return std
        

def dfsupper(std) :
    """
    argument x : 基準となる数字
    y 結果となりうる数字？
    return : 結果
    """
    if std  in p_list:
        return dfsupper(std+1)
        #print(std)
    else:
        return(std)

mininte = dfslower(x)
maxinte =  dfsupper(x)

if abs(mininte-x)> abs(maxinte -x):
    print(maxinte)
elif abs(mininte-x) <= abs(maxinte -x):
    print(mininte)
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
N,X = map(int,input().split())

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


res = 0
i = 0
ans = 1
for i in range(N):
    res += li[i]
    ans += 1
    if res > X:
        ans -= 1
        break
    
print(min(ans,N+1))
    

Fixed submission:
import sys
input = sys.stdin.readline
X,A = map(int,input().split())

if X < A:
    print(0)

else:
    print(10)
Buggy python submission (verdict: Runtime Error):

N = int(input())
li = []
for i in range(N):
    a = list(map(int,input().split()))
    li.append(a)

cross = []

##計算量に余裕があるので全探索します
for i in range(N):
    for j in range (i+1, N):
        a = [li[j][0]-li[i][0],li[j][1]-li[i][1]]
        cross.append(a) 

lencross = len(cross)

res = 0
ans = []

for i in range (lencross):
    res = 0
    for j in range (lencross):
        if cross[i] == cross[j]:
            res += 1
    ans.append(res)
if N-1 < max(ans):
    reduce = N-1
else:
    reduce = max(ans)

if N != 1:
    print(N - reduce)
else:
    print(1)   

Fixed submission:
import sys
input = sys.stdin.readline
N,K = map(int,input().split())

if K == 1:
    print(0)

else:
    print(N-K)
Buggy python submission (verdict: Runtime Error):
import numpy as np
import sys
input = sys.stdin.readline
res = 0
p = 0
R, G, B, N = map(int, input().split())
for i in range (N // R + 1):
    for j in range(N // G + 1):
        P =N - i*R - j*G
        if P < 0:
            break
        else:
            if(P % B == 0):
                res += 1


print(res)

Fixed submission:
N, K =  map(int,input().split())
print(N-K+1)
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

n = int(input())
s = list(input())
res = 10**6
ctw = 0
ctb = 0
w = [0]*n
b = [0]*n

for i in range(n):
     if s[i] == ".":
          ctw += 1
     else:
          ctb += 1
     w[i]= ctw
     b[i]= ctb
for i in range(n):
     res = min(res,b[i]+w[-1]-w[i])
res = min(res,[-1],b[-1])
print(res)
      

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

n = int(input())
s = list(input())
res = 10**9

cta = 0
ctb = 0
a = [0]*n
b = [0]*n
for i in range(n):
    if s[i] == '.':
        cta += 1
    else:
        ctb += 1
    a[i] = cta
    b[i] = ctb
for i in range(n):
    res = min(res,b[i]+a[-1]-a[i])
res = min(res,a[-1],b[-1])
print(res)

Buggy python submission (verdict: Runtime Error):

import sys
input = sys.stdin.readline

n = int(input())
s = list(input())
res = 10**9



ctw = 0
ctb = 0
w = [0]*n
b = [0]*n

for i in range(n):
     if s[i] == ".":
          ctw += 1
     else:
          ctb += 1
     w[i]= ctw
     b[i]= ctb
for i in range(n):
     res = res,b[i]+w[-1]-w[i]
res = min(res,w[-1],b[-1])
print(res)

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

n = int(input())
s = list(input())
res = 10**9

cta = 0
ctb = 0
a = [0]*n
b = [0]*n
for i in range(n):
    if s[i] == '.':
        cta += 1
    else:
        ctb += 1
    a[i] = cta
    b[i] = ctb
for i in range(n):
    res = min(res,b[i]+a[-1]-a[i])
res = min(res,a[-1],b[-1])
print(res)
Buggy python submission (verdict: Runtime Error):
s = list(input())
N = len(s)
cont = 0
for i in xrange(1,N):
    if s[i-1]==s[i]:
        cont += 1
        if s[i] == '0':
            del s[i]
            s.insert(i, '1')          
        else:
            del s[i]
            s.insert(i, '0')    
print(cont)

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

list= [A+A-1,B+B-1,A+B]
print(max(list))
Buggy python submission (verdict: Runtime Error):
s = input()

for bit in range(1 << (3)):
    f = s[0]
    
    for i in range(3):
        # if bit & (1 << i)で、bitにiが含まれているか（フラグが立っているか）を判定してくれるらしい
        if bit & (1 << i):
            f += '+'
        f += s[i + 1]
    if sum(list(map(int, f.split('+')))) == 7:
        print(f"{f}=7")
        exit()

Fixed submission:
s = input()

for bit in range(1 << (3)):
    f = s[0]
    
    for i in range(3):
        # if bit & (1 << i)で、bitにiが含まれているか（フラグが立っているか）を判定してくれるらしい
        if bit & (1 << i):
            f += '+'
        else:
            f += '-'
        f += s[i+1]    
    if eval(f)  == 7:
        f += "=7"
        print(f)
        exit()
Buggy python submission (verdict: Runtime Error):
s = input()
k = len(s)

# def dfs(i, f) :
#     """
#     argument i : どこから始めるか
#     f :　最初の数
#     returen : falese or ture(作れるならtrue)
#     """
#     if i == k-1:
#         return sum(list(map(int, f.split('+'))))

#     return dfs(i+1, f + s[ i +1 ]) + \
#            dfs(i+1, f + '+' +  s[ i +1 ]) 

# print(dfs(0, s[0]))

#bit木を書いていきます

ans = 0

for bit in range(1 << (k-1)):
    f = s[0]
    
    for i in range(k-1):
        # if bit & (1 << i)で、bitにiが含まれているか（フラグが立っているか）を判定してくれるらしい
        if bit & (1 << i):
            f += '+'
        f += f[i + 1]
    ans += sum(list(map(int, f.split('+'))))

print(ans)

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

ans = 0

for bit in range(1 << (n - 1)):
    # 各場合で式 f を生成する
    f = s[0]

    for i in range(n - 1):
        if bit & (1 << i):
            # フラグが立っているならば "+" を式の末尾に追加する
            f += "+"
        f += s[i + 1]

    ans += sum(map(int, f.split("+")))

print(ans)

Buggy python submission (verdict: Runtime Error):
s = input()
k = len(s)

# def dfs(i, f) :
#     """
#     argument i : どこから始めるか
#     f :　最初の数
#     returen : falese or ture(作れるならtrue)
#     """
#     if i == k-1:
#         return sum(list(map(int, f.split('+'))))

#     return dfs(i+1, f + s[ i +1 ]) + \
#            dfs(i+1, f + '+' +  s[ i +1 ]) 

# print(dfs(0, s[0]))

#bit木を書いていきます

ans = 0

for bit in range(1 << k-1):
    f = s[0]
    
    for i in range(k-1):
        # if bit & (1 << i)で、bitにiが含まれているか（フラグが立っているか）を判定してくれるらしい
        if bit & (1 << i):
            f += '+'
        f += f[i + 1]
    ans += sum(list(map(int, f.split('+'))))

print(ans)

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

ans = 0

for bit in range(1 << (n - 1)):
    # 各場合で式 f を生成する
    f = s[0]

    for i in range(n - 1):
        if bit & (1 << i):
            # フラグが立っているならば "+" を式の末尾に追加する
            f += "+"
        f += s[i + 1]

    ans += sum(map(int, f.split("+")))

print(ans)

Buggy python submission (verdict: Runtime Error):
s = input()
k = len(s)

ans = 0

for bit in range(1 << k-1):
    f = s[0]
    
    for i in range(k-1):
        # if bit & (1 << i)で、bitにiが含まれているか（フラグが立っているか）を判定してくれるらしい
        if bit & (1 << i):
            f += '+'
        f += f[i + 1]
    ans += sum(list(map(int, f.split('+'))))

print(ans)

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

ans = 0

for bit in range(1 << (n - 1)):
    # 各場合で式 f を生成する
    f = s[0]

    for i in range(n - 1):
        if bit & (1 << i):
            # フラグが立っているならば "+" を式の末尾に追加する
            f += "+"
        f += s[i + 1]

    ans += sum(map(int, f.split("+")))

print(ans)
Buggy python submission (verdict: Runtime Error):
N,Y = map(int,input().split())
exist_flag = False
for i in range(N+1):
    for j in range(N+1-i):
        if Y == 10000*i + 5000*j + 1000*(N-i-j):
            exist_flag = True
            break
    if exist_flag:
        break
if not exist_flag:
    i,j,k = -1, -1, -1
print(i, j, k)

Fixed submission:
s = input()
print(s.replace('2017', '2018'))
Buggy python submission (verdict: Runtime Error):
N,Y = map(int,input().split())
exist_flag = False
for i in range(N+1):
    for j in range(N+1-i):
        if Y == 10000*i + 5000*j + 1000*(N-i-j):
            exist_flag = True
            break
    if exist_flag:
        break
if not exist_flag:
    i,j,k = -1, -1, -1
print(i, j, k)

Fixed submission:
N,Y = map(int,input().split())
exist_flag = False
for i in range(N+1):
    for j in range(N+1-i):
        if Y == 10000*i + 5000*j + 1000*(N-i-j):
            exist_flag = True
            break
    if exist_flag:
        break
if not exist_flag:
    print(-1, -1, -1)
else:
    print(i, j, N-i-j)

Buggy python submission (verdict: Runtime Error):
N,Y = map(int,input().split())
exist_flag = False
exist_flag = False
for i in range(N+1):
    for j in range(N+1-i):
        if Y == 10000*i + 5000*j + 1000*(N-i-j):
            exist_flag = True
            break
    if exist_flag:
        break
if not exist_flag:
    i,j,k = -1, -1, -1
print(i, j, k)

Fixed submission:
N,Y = map(int,input().split())
exist_flag = False
for i in range(N+1):
    for j in range(N+1-i):
        if Y == 10000*i + 5000*j + 1000*(N-i-j):
            exist_flag = True
            break
    if exist_flag:
        break
if not exist_flag:
    print(-1, -1, -1)
else:
    print(i, j, N-i-j)

Buggy python submission (verdict: Time Limit Exceeded):
N,Y = map(int,input().split())
exist_flag = False
for i in range(N+1):
    for j in range(N+1):
        for k in range(N+1):
            if not i+j+k == N:
                continue
            if Y == 10000*i + 5000*j + 1000*k:
                exist_flag = True
                break
        if exist_flag:
            break
    if exist_flag:
        break
if not exist_flag:
    i,j,k = -1, -1, -1
print(i, j, k)

Fixed submission:
N,Y = map(int,input().split())
exist_flag = False
for i in range(N+1):
    for j in range(N+1-i):
        if Y == 10000*i + 5000*j + 1000*(N-i-j):
            exist_flag = True
            break
    if exist_flag:
        break
if not exist_flag:
    print(-1, -1, -1)
else:
    print(i, j, N-i-j)

Buggy python submission (verdict: Runtime Error):
N = int(input())
Y = int(input())
exist_flag = False
for i in range(N+1):
    for j in range(N+1):
        for k in range(N+1):
            if not i+j+k == N:
                continue
            if Y == 10000*i + 5000*j + 1000*k:
                exist_flag = True
                break
        if exist_flag:
            break
    if exist_flag:
        break
if not exist_flag:
    i,j,k = -1, -1, -1
print(i, j, k)

Fixed submission:
N,Y = map(int,input().split())
exist_flag = False
for i in range(N+1):
    for j in range(N+1-i):
        if Y == 10000*i + 5000*j + 1000*(N-i-j):
            exist_flag = True
            break
    if exist_flag:
        break
if not exist_flag:
    print(-1, -1, -1)
else:
    print(i, j, N-i-j)
Buggy python submission (verdict: Runtime Error):
n = int(input())
print(Decimal(n / 2))

Fixed submission:
n = int(input())
ans = 0
if n % 2 ==  0:
    ans = int(n / 2)
else: 
    ans = int(n / 2) + 1

print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(map(int, input().split()))

for i in range(len(s)):
    s[i] = s[i] - n
    s[i] = s[i] * s[i]
ans = 0
for i in range(len(s)):
    ans += s[i]

print(ans)

Fixed submission:
i = list(map(int,input().split()))
ans = 0
if i[0] >=10:
    ans = i[1]
else:
    ans = i[1] + 100 * (10 - i[0])

print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
m = list(map(int, input().split()))
m = set(m)

for i int range(len(m))
    if i % 2 == 0:
        if i % 5 == 0 or i % 3 == 0:
            ans = 'APPROVED'
        else:
            ans = 'DENIED'

print(ans)

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

ans = "APPROVED"

for i in range(len(m)):
    if ans == "DENIED":
        break;
    if m[i] % 2 == 0:
        if m[i] % 5 == 0 or m[i] % 3 == 0:
            ans = 'APPROVED'
        else:
            ans = 'DENIED'
            break;

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = input().split()
ans = 'YES'

for i in range(n):
    if ans == 'NO':
        break;
    for j in range(i + 1, n):
        if a[i] == a[j]:
            ans = "NO"
            break;

print(ans)

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

a = set(a)
if n == len(a):
    print('YES')
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
s = input().split() #標準入力　sに値を入れる

def sort(A):
    if len(A) < 2:
        return A
    c = len(A)//2
    return merge(sort(A[:c]), sort(A[c:]))

def merge(X, Y):
    if len(X) < 1:
        return Y
    if len(Y) < 1:
        return X
    if (X[0] > Y[0]):
        return [Y[0]]+ merge(X, Y[1:])
    else:
        return [X[0]] + merge(X[1:], Y)

n = int(s[0])
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(divisors)
l = len(divisors)
n1 = divisors[l // 2 - 1]
n2 = divisors[l // 2]
ans = n1 + n2 - 2
print(n2)

Fixed submission:
import math
s = input().split() #標準入力　sに値を入れる
n = int(s[0])
root = int(math.sqrt(n))
ans = 10**18
for i in range(1, root + 1):
    if n % i != 0:
        continue
    j = n / i
    ans = min(ans, i + j - 2)
print(int(ans))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
nums = sorted(list(map(int,input().split())), reverse=True)

res = 1
for i in range(n):
  res = res * nums[i]
  if res <= 10**18 or 0 in nums:
    continue
  else:
    res = -1
    break
    
print(res)


Fixed submission:
n = int(input())
nums = sorted(list(map(int,input().split())), reverse=True)

res = 1

if 0 in nums:
  print(0)
  exit()
  
for i in range(n):
  res = res * nums[i]
  if res <= 10**18 :
    continue
  else:
    res = -1
    break
print(res)

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

res = 1
for i in range(n):
  res = res * nums[i]
print(res if res <= 10**18 else -1)

Fixed submission:
n = int(input())
nums = sorted(list(map(int,input().split())), reverse=True)

res = 1

if 0 in nums:
  print(0)
  exit()
  
for i in range(n):
  res = res * nums[i]
  if res <= 10**18 :
    continue
  else:
    res = -1
    break
print(res)

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

res = 1
for i in range(n):
  res = res * nums[i]
print(res if res <= 10**18 else -1)

Fixed submission:
n = int(input())
nums = sorted(list(map(int,input().split())), reverse=True)

res = 1

if 0 in nums:
  print(0)
  exit()
  
for i in range(n):
  res = res * nums[i]
  if res <= 10**18 :
    continue
  else:
    res = -1
    break
print(res)
Buggy python submission (verdict: Runtime Error):
if input()[-1] in ("2", "4", "5", "7", "9"):
  print("hon")
elif input()[-1] in ("0", "1", "6", "8"):
  print("pon")
else:
  print("bon")

Fixed submission:
a = input()
if a[-1] in ("2", "4", "5", "7", "9"):
  print("hon")
elif a[-1] in ("0", "1", "6", "8"):
  print("pon")
else:
  print("bon")
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(map(int, input().split(' ')))
#p = [list(map(int, input().split())) for _ in range(n)]
p = sorted(p, reverse=True)
if len(p) != n or n < 4:
  raise ValueError

#print(p[0], p[1:])
if p[0] < sum(p[1:]):
	print('Yes')
else:
	print('No')

Fixed submission:

t, x = map(int, input().split(' '))
print(t/x)

Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(map(int, input().split(' ')))
#p = [list(map(int, input().split())) for _ in range(n)]
p = sorted(p, reverse=True)
if len(p) != n:
  raise ValueError

#print(p[0], p[1:])
if p[0] < sum(p[1:]):
	print('Yes')
else:
	print('No')

Fixed submission:

t, x = map(int, input().split(' '))
print(t/x)

Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(map(int, input().split(' ')))
p = sorted(p, reverse=True)

if p[0] < sum(p[1:]):
	print('Yes')
else:
	print('No')

Fixed submission:

t, x = map(int, input().split(' '))
print(t/x)

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

p = sorted(p)
if p[0] < sum(p[1:]):
	print('Yes')
else:
	print('No')

Fixed submission:

t, x = map(int, input().split(' '))
print(t/x)