Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
X=int(input())
n=26

a=[]
X_dumy = X
out = ''
while X_dumy>0:
  out = str(X_dumy%n)
  X_dumy = int(X_dumy/n)
  a.append(out)

l = list('abcdefghijklmnopqrstuvwxyz')
N=0
for x in a:
  a[N]=l[int(a[N])-1]
  N=N+1
pg = ''.join(a)
print(pg)

Fixed submission:
if input().isupper():
  print("A")
else:
  print("a")
Buggy python submission (verdict: Runtime Error):
a=34

if a==int
print(6)

Fixed submission:
from fractions import Fraction

a=input()
a=a.split()

X=int(a[0])
Y=int(a[1])

x=Fraction(4*X-Y,2)
y=Fraction(Y-2*X,2)

if x-round(x)==0 and x >= 0:
  if y-round(y)==0 and y >= 0:
    print("Yes")
  else :
    print("No")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a=input()
a=a.split()
x=int(a[0])
p=input()
p=p.split()

i=0
p_1=p+[]



for y in p_1:
  p_1[i]=abs(int(p_1[i])-x)
  i=i+1

p_1.sort()
if p_1[0]==0:
  del p_1[0]

q=p_1[0]
if str(x-q) in p:
  print(x-q)
else:
  print(x+q)






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

for y in range(x+1):
  for b in[-1,1]:
    c=x+y*b
    if a.count(c)==0:
      print(c)
      exit(0)
Buggy python submission (verdict: Runtime Error):
str = S

print(str[0:2])


Fixed submission:
S= input()

str = S

print(str[0:3])
Buggy python submission (verdict: Runtime Error):
s=input()
a=input()
a=a.split()


c=1
for x in a:
  c=c*int(x)
  
if c > 10**18:
  print("-1")
else:  
  print(c) 


Fixed submission:
a=input()

a=a.split()

A=int(a[0])
B=int(a[1])
C=A*B

print(C)

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

a=a.split()

x=a[0]
y=a[1]

c=x*y

print(c)

Fixed submission:
a=input()

a=a.split()

A=int(a[0])
B=int(a[1])
C=A*B

print(C)
Buggy python submission (verdict: Time Limit Exceeded):
a=int(input())
A=list(map(int,input().split()))
ans=1
for x in A:
  ans*=x

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


Fixed submission:
a=int(input())
A=list(map(int,input().split()))
ans=1
if A.count(0)==0:
    for x in A:
      ans*=x
      if ans>10**18:
        break


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

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
a=input()
a=a.split()


c=1
for x in a:
  c=c*int(x)
  
if c <= 10**18:
  print(c)
else:  
  print("-1") 


Fixed submission:
a=int(input())
A=list(map(int,input().split()))
ans=1
if A.count(0)==0:
    for x in A:
      ans*=x
      if ans>10**18:
        break


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

Buggy python submission (verdict: Runtime Error):
s=input()
a=input()
a=a.split()


c=1
for x in a:
  c=c*int(x)
  
if c =< 10**18:
  print(c)
else:  
  print("-1") 


Fixed submission:
a=int(input())
A=list(map(int,input().split()))
ans=1
if A.count(0)==0:
    for x in A:
      ans*=x
      if ans>10**18:
        break


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

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
a=input()
a=a.split()
c=1
for x in a:
  c=c*int(x)
if c > 10**18:
  print("-1")
else:  
  print(c) 


Fixed submission:
a=int(input())
A=list(map(int,input().split()))
ans=1
if A.count(0)==0:
    for x in A:
      ans*=x
      if ans>10**18:
        break


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

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
a=input()
a=a.split()


c=1
for x in a:
  c=c*int(x)
  
if c > 10**18:
  print("-1")
else:  
  print(c) 


Fixed submission:
a=int(input())
A=list(map(int,input().split()))
ans=1
if A.count(0)==0:
    for x in A:
      ans*=x
      if ans>10**18:
        break


    if ans>10**18:
      print(-1)
    else:
      print(ans)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
x=input()


x=int(a[0])

if x%10== 2 or 4 or 5 or 7 or 9:
  print("hon")
elif x%10== 0 or 1 or 6 or 8:
  print("pon")
else x%10== 3:
  print("hon")


Fixed submission:
a=int(input())

a = a%10

if a== 2 or a==4 or a==5 or a==7 or a==9:
  print("hon")
elif a== 0 or a==1 or a==6 or a==8:
  print("pon")
else :
  print("bon")
Buggy python submission (verdict: Runtime Error):
a=input()
a=a.split()

x=str(a[0])
y=str(a[1])

y=y[:-1]

if x==y:
  print("Yes")
else:
  print("No")

Fixed submission:
x=input()
b=input()

y=b[:-1]

if x==y:
  print("Yes")
else:
  print("No")

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

x=str(a[0])
y=str(a[1])

y=txt[:-1]

if x=y:
  print("Yes")
else:
  print("No")

Fixed submission:
x=input()
b=input()

y=b[:-1]

if x==y:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
if int(input())==ABC:
  print("ARC")
else :
  print("ABC")

Fixed submission:
if input()=="ABC":
  print("ARC")
else :
  print("ABC")
Buggy python submission (verdict: Runtime Error):
a=list.input()

if a[2]==a[3] and a[4]==a[5]:
  print("Yes")
else:
  print("No")

Fixed submission:
s=input()

a=s[2]
b=s[3]
c=s[4]
d=s[5]

if a==b and c==d:
  print("Yes")
else :
  print("No")
Buggy python submission (verdict: Runtime Error):
a=input()
b=input()
print(b+a)

Fixed submission:
a,b=map(str,input().split())
print(b+a)
Buggy python submission (verdict: Time Limit Exceeded):
N = 100000
g = [[] for i in range(N)] 
  
# To check if the vertex  
# has been visited or not 
vis = [False for i in range(N)] 
  
# To store if vertex is reachable 
# from source or not 
good = [False for i in range(N)] 
  
def ADD_EDGE(u, v): 
  
    g[u].append(v) 
  
# Function to find all good vertices 
def dfs1(v): 
  
    good[v] = True
    for to in g[v]: 
        if not good[to]: 
            dfs1(to) 
  
# Function to find cnt of 
# all unreachable vertices 
def dfs2(v): 
      
    global cnt 
    vis[v] = True
    cnt += 1
    for to in g[v]: 
        if not vis[to] and not good[to]: 
            dfs2(to) 
  
# Function to return   
# the minimum edges required 
def Minimum_Edges(): 
  
    global vis, cnt 
      
    # Find all vertices reachable 
    # from the source 
    dfs1(x) 
  
    # To store all vertices  
    # with their cnt value 
    val = [] 
  
    for i in range(0, n):  
  
        # If vertex is bad i.e. not reachable 
        if not good[i]: 
            cnt = 0
            vis = [False for i in range(N)] 
  
            # Find cnt of this vertex 
            dfs2(i) 
            val.append((cnt, i)) 
  
    # Sort all unreachable vertices  
    # in non-decreasing order of 
    # their cnt values 
    val.sort(reverse = True) 
  
    # Find the minimum number of edges 
    # needed to be added 
    ans = 0
    for it in val:  
        if not good[it[1]]:  
            ans += 1
            dfs1(it[1]) 
  
    return ans 
  
# Driver code 
if __name__ == "__main__": 
  
    # Number of nodes and source node 
    n, m = map(int, input().split())
    x = 0
  
    # Add edges to the graph
    for i in range(m):
        u, v = map(int, input().split())
        ADD_EDGE(u, v)
  
    print(Minimum_Edges())


Fixed submission:
import sys
input = sys.stdin.readline
 
n,m=map(int,input().split())
d={i+1:[] for i in range(n)}
for i in range(m):
    x,y=map(int,input().split())
    d[x].append(y)
    d[y].append(x)
 
visit=set()
ans= 0 
for i in range(1,n+1):
    if i not in visit:
        ans+=1
        stack = [i]
        while stack:
            c=stack.pop()
            visit.add(c)
            for i in d[c]:
                if i not in visit:
                    stack.append(i)
print(ans-1)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
arr = [0]*(N+2)
 
for x in range(1,151):
    for y in range(1,151):
        for z in range(1,151):
            n = x**2 + y**2 + z**2 + x*y + y*z + x*z 
            if n <= N :
                arr[n] += 1
 
for i in range(1,N+1):
    print(arr[i])

Fixed submission:
N = int(input())
arr = [0]*(N+2)
 
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            n = x**2 + y**2 + z**2 + x*y + x*z + y*z
            if n <= N :
                arr[n] += 1
 
for i in range(1,N+1):
    print(arr[i])

Buggy python submission (verdict: Time Limit Exceeded):
from math import sqrt
from math import ceil
N = int(input())
s = ceil(sqrt(N))
for i in range(1, N+1):
  count = 0
  for x in range(1,s+1):
    for y in range(1,s+1):
      for z in range(1,s+1):
        if (x**2 + y**2 + z**2 + x*y + y*z + x*z) == i:
          count += 1
  print(count)

Fixed submission:
N = int(input())
arr = [0]*(N+2)
 
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            n = x**2 + y**2 + z**2 + x*y + x*z + y*z
            if n <= N :
                arr[n] += 1
 
for i in range(1,N+1):
    print(arr[i])
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
o=0

for i in range(1,n):
    b=1
    while i*b<n:
        o+=1
        b+=1
print(o)

Fixed submission:
n=int(input())
o=0
nn=n-1
for i in range(1,n):
    o+=nn//i
print(o)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int, input("").split()))
o=0
for i in range(n-1):
    for j in range(i+1,n):
        o+=a[i]*a[j]
        o%=10**9+7
print(o)

Fixed submission:
n=int(input())
a=list(map(int, input("").split()))
o=0
aa=[]
for i in a:
    aa.append(i**2)
s=sum(a)
o=(s**2-sum(aa))//2
o%=10**9+7
print(o)
Buggy python submission (verdict: Time Limit Exceeded):
n,m=list(map(int, input("").split()))
h=list(map(int, input("").split()))
a=[]
b=[]
for i in range(m):
    ai,bi=list(map(int, input("").split()))
    a.append(ai)
    b.append(bi)
ma=0
out=0
for i in range(n):
    ma=h[i]
    q=h[i]
    for j in range(m):
        if i==a[j]-1 or i==b[j]-1:
            if i==a[j]-1:
                if h[b[j]-1] >= ma:
                    ma=10**9+1
                    break
            else:
                if h[a[j]-1] >= ma:
                    ma=10**9+1
                    break
    if ma==q:  
        out+=1
print(out)

Fixed submission:
n,m=list(map(int, input("").split()))
h=list(map(int, input("").split()))
o=[]
for i in range(n):
    o.append(1)
for i in range(m):
    a,b=list(map(int, input("").split()))
    if h[a-1] <=h[b-1]:
        o[a-1]=0
    if h[a-1] >=h[b-1]:
        o[b-1]=0
print(sum(o))
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n=int(input())
lis=list(map(int, input().split())) 
out=0
for conb in itertools.combinations(lis, 3):
    l=list(conb)
    a=l[0]
    b=l[1]
    c=l[2]
    if a < b + c and b < c + a and c < a + b:
        out+=1
print(out)

Fixed submission:
import bisect
n=int(input())
lis=list(map(int, input().split())) 
lis.sort()
out=0
for i in range(n):
    for j in range(1+i,n):
        out+=bisect.bisect_left(lis,lis[i]+lis[j])-j-1
print(out)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a = list(map(int, input("").split()))
b = list(map(int, input("").split()))
c = list(map(int, input("").split()))
out=0
a.sort()
b.sort()
c.sort()
for i in range(n):
    for j in range(n):
        if b[j] > a[i]:
            for k in range(n):
                if c[k] > b[j]:
                    out+=(n-k)
                    break
print(out)

Fixed submission:
import bisect
n=int(input())
a = list(map(int, input("").split()))
b = list(map(int, input("").split()))
c = list(map(int, input("").split()))
out=0
a.sort()
b.sort()
c.sort()
for i in b:
    na = bisect.bisect_left(a,i)
    nc = bisect.bisect(c,i)
    out += na * (len(c)-nc)
print(out)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a = list(map(int, input("").split()))
b = list(map(int, input("").split()))
c = list(map(int, input("").split()))
out=0
for i in a:
    for j in b:
        for k in c:
            if k > j and j > i:
                out+=1
print(out)

Fixed submission:
import bisect
n=int(input())
a = list(map(int, input("").split()))
b = list(map(int, input("").split()))
c = list(map(int, input("").split()))
out=0
a.sort()
b.sort()
c.sort()
for i in b:
    na = bisect.bisect_left(a,i)
    nc = bisect.bisect(c,i)
    out += na * (len(c)-nc)
print(out)
Buggy python submission (verdict: Runtime Error):
n = [int(x) for x in input()]
op_cnt = len(n) - 1  
out=0
for i in range(2 ** op_cnt):
    op = ["+"] * op_cnt  
    for j in range(op_cnt):
        if ((i >> j) & 1):
            op[op_cnt - 1 - j] = "" 
        box=""  
    for a,b in zip(n,op+[""]):
        box+=(str(a)+b)
    box=box.split('+')
    ou=0
    for k in box:
        out+=int(k)
print(out)

Fixed submission:
n = [int(x) for x in input()]
op_cnt = len(n) - 1  
out=0
for i in range(2 ** op_cnt):
    op = ["+"] * op_cnt  
    box=""
    for j in range(op_cnt):
        if ((i >> j) & 1):
            op[op_cnt - 1 - j] = "" 
        box=""  
    for a,b in zip(n,op+[""]):
        box+=(str(a)+b)
    box=box.split('+')
    ou=0
    for k in box:
        out+=int(k)
print(out)
Buggy python submission (verdict: Runtime Error):
s = input()
if '7' in s:
  print("Yes)
else:
  print("No")

Fixed submission:
s = input()
if '7' in s:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = [int(e) for e in input().split()]

m = 1
for e in a:
    m *= e

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


Fixed submission:
N = int(input())
a = [int(e) for e in input().split()]

if 0 in a:
    print(0)
    exit(0)

m = 1
for e in a:
    m *= e
    if m > 10 ** 18:
        print(-1)
        exit(0)

print(m)
Buggy python submission (verdict: Runtime Error):
def lcm(a, b):
    from math import gcd

    return a // gcd(a, b) * b


def main():
    _ = int(input())
    a = list(map(int, input().split()))
    x = 1

    for e in a:
        x = lcm(x, e)

    ans = 0
    for e in a:
        ans += x // e

    print(ans % int(1e9 + 7))


main()


Fixed submission:
def lcm(a, b):
    from fractions import gcd

    return a // gcd(a, b) * b


def main():
    _ = int(input())
    a = list(map(int, input().split()))
    x = 1

    for e in a:
        x = lcm(x, e)

    ans = 0
    for e in a:
        ans += x // e

    print(ans % int(1e9 + 7))


main()

Buggy python submission (verdict: Time Limit Exceeded):
def gcd(a, b):
    while b:
        r = a % b
        a,b = b,r
    return a

def lcm(a, b):
    return a // gcd(a, b) * b

MOD = 10**9 + 7

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

m = 1
for e in a:
    m = lcm(m, e)

ans = 0
for e in a:
    ans += m // e
    ans %= MOD

print(ans)


Fixed submission:
def lcm(a, b):
    from fractions import gcd

    return a // gcd(a, b) * b


def main():
    _ = int(input())
    a = list(map(int, input().split()))
    x = 1

    for e in a:
        x = lcm(x, e)

    ans = 0
    for e in a:
        ans += x // e

    print(ans % int(1e9 + 7))


main()

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

def lcm(a, b):
    return a // gcd(a, b) * b

MOD = 10**9 + 7

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

m = 1
for e in a:
    m = lcm(m, e)

ans = 0
for e in a:
    ans += m // e
    ans %= MOD

print(ans)


Fixed submission:
def lcm(a, b):
    from fractions import gcd

    return a // gcd(a, b) * b


def main():
    _ = int(input())
    a = list(map(int, input().split()))
    x = 1

    for e in a:
        x = lcm(x, e)

    ans = 0
    for e in a:
        ans += x // e

    print(ans % int(1e9 + 7))


main()

Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
a = list(map(int, input().split(' ')))
nok = a[0]
mod = int(1e9 + 7)
for i in range(1, n):
    nok = nok * a[i] // math.gcd(nok, a[i])
ans = 0
for i in range(0, n):
    ans += nok // a[i]
print (ans % mod)

Fixed submission:
def gcd(x, y): 

    while(y): 
        x, y = y, x % y 
    
    return x 

n = int(input())
a = list(map(int, input().split(' ')))
nok = a[0]
mod = int(1e9 + 7)
for i in range(1, n):
    nok = nok * a[i] // gcd(nok, a[i])
ans = 0
for i in range(0, n):
    ans += nok // a[i]
print (ans % mod)
Buggy python submission (verdict: Runtime Error):
from operator import mul
from functools import reduce

#while True:
N = int(input())
#	if N>=2 and N<=10**5:break

if 2 <= N <= 10**5:
	num = list(map(int, input().split()))
	
#print(num)
ans = reduce(mul,num)
if ans > 10**18:
	print(-1)
else:
	print(ans)

Fixed submission:
A, B = map(int, input().split())
print(A*B)
Buggy python submission (verdict: Time Limit Exceeded):
from operator import mul
from functools import reduce

#while True:
N = int(input())
#	if N>=2 and N<=10**5:break

if 2 <= N <= 10**5:
	num = list(map(int, input().split()))
	ans = reduce(mul,num)
if ans > 10**18:
	print(-1)
else:
	print(ans)

Fixed submission:
def main():
    n = int(input())
    a = list(map(int,input().split()))
    if 0 in a: 
        print(0)
        return
    ans = 1
    for ai in a:
        ans *= ai
        if ans > 10**18:
            print(-1)
            return
    print(ans)
    
if __name__ =="__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
inputNum = int(input())

if 2 <= inputNum <= 10**5:
    list = list(map(int, input().split()))
    val = 1
    for item in list:
        val = val * item
    if 0 <= val <= 10**18:
        print(val)
    elif 10**18 < val:
        print(-1)


Fixed submission:
def main():
    n = int(input())
    a = list(map(int,input().split()))
    if 0 in a: 
        print(0)
        return
    ans = 1
    for ai in a:
        ans *= ai
        if ans > 10**18:
            print(-1)
            return
    print(ans)
    
if __name__ =="__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
inputNum = int(input());

if 2 <= inputNum <= 10**5:
    list = list(map(int, input().split()))
    val = 1;
    for item in list:
        val = val * item
    if 0 <= val <= 10**18:
        print(val)
    elif 10**18 < val:
        print(-1)


Fixed submission:
def main():
    n = int(input())
    a = list(map(int,input().split()))
    if 0 in a: 
        print(0)
        return
    ans = 1
    for ai in a:
        ans *= ai
        if ans > 10**18:
            print(-1)
            return
    print(ans)
    
if __name__ =="__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
from operator import mul
from functools import reduce

while True:
	N = int(input())
	if N>=2 and N<=10**5:break

while True:
	num = list(map(int, input().split()))
	if N==len(num):break

#print(num)
ans = reduce(mul,num)
if ans > 10**18:
	print(-1)
else:
	print(ans)


Fixed submission:
def main():
    n = int(input())
    a = list(map(int,input().split()))
    if 0 in a: 
        print(0)
        return
    ans = 1
    for ai in a:
        ans *= ai
        if ans > 10**18:
            print(-1)
            return
    print(ans)
    
if __name__ =="__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
from operator import mul
from functools import reduce
N = int(input())
s =list(map(int, input().split()))
ans = reduce(mul,s)
if ans > 10**18:
	print(-1)
else:
	print(ans)

Fixed submission:
def main():
    n = int(input())
    a = list(map(int,input().split()))
    if 0 in a: 
        print(0)
        return
    ans = 1
    for ai in a:
        ans *= ai
        if ans > 10**18:
            print(-1)
            return
    print(ans)
    
if __name__ =="__main__":
    main()
Buggy python submission (verdict: Runtime Error):
D = int(input())
T = int(input())
S = int(input())

res = D/S
if(res <= T):
    print("Yes")
else:
    print("No")


Fixed submission:
D, T, S = map(int,input().split())

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

Buggy python submission (verdict: Runtime Error):
D = int(input())
T = int(input())
S = int(input())

res = S*T
if(res >= D):
    print("Yes")
else:
    print("No")


Fixed submission:
D, T, S = map(int,input().split())

if(D/S <= T):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
x, n = map(int, input().split())
p = list(map(int,input().split()))

ans1 = int()
ans2 = int()

p.sort()

if x not in p:
    print(x)
    sys.exit()

for i in range(n):
    if x == p[i]:
        for j in range(x + 1, 100):
            if j not in p:
                ans1 = j
                break
        for k in reversed(range(x,)):
            if k not in p:
                ans2 = k
                break

if ans1 - x < x - ans2:
    print(ans1)
else:
    print(ans2)


Fixed submission:
import sys

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

p.sort()

if x not in p:
    print(x)
    sys.exit()

for i in range(0, 100):
    if (x - i) not in p:
        print(x - i)
        sys.exit()
    if (x + i) not in p:
        print(x + i)
        sys.exit()
Buggy python submission (verdict: Runtime Error):
import sys

n= int(input())
a = list(map(int,input().split()))
ans = a[0]
ans_max = 10 ** 18

for i in range(1, n):
    ans *= a[i]
    if ans > ans_max:
        print("-1")
        sys.exit()

print(ans)

Fixed submission:
a, b= input().split()

print(int(a) * int(b))

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

print(a * b)

Fixed submission:
a, b= input().split()

print(int(a) * int(b))
Buggy python submission (verdict: Runtime Error):
n= int(input())
a = list(map(int,input().split()))
ans = a[0]
ans_max = 10 ** 18

for i in range(1, n):
    ans *= a[i]
    if ans > ans_max:
        print("-1")
        sys.exit()

print(ans)

Fixed submission:
import sys

n= int(input())
a = list(map(int,input().split()))
ans = a[0]
ans_max = 10 ** 18

if 0 in a:
    print(0)
    sys.exit()

for i in range(1, n):
    ans *= a[i]
    if ans > ans_max:
        print("-1")
        sys.exit()

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n= int(input())
a = list(map(int,input().split()))
ans = int(a[0])

for i in range(1, n):
    ans *= a[i]
    
if ans > 10 ** 18:
    print("-1")
else:
    print(ans)

Fixed submission:
import sys

n= int(input())
a = list(map(int,input().split()))
ans = a[0]
ans_max = 10 ** 18

if 0 in a:
    print(0)
    sys.exit()

for i in range(1, n):
    ans *= a[i]
    if ans > ans_max:
        print("-1")
        sys.exit()

print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
import math

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

ans = a[0]

for i in range(1, n):
    ans *= a[i]
    if math.log10(ans) > 18:
        print("-1")
        sys.exit()


print(ans)

Fixed submission:
from decimal import Decimal

a, b = [Decimal(str(x)) for x in input().split()]

c = a * b

print(int(c))
Buggy python submission (verdict: Runtime Error):
import math

a, b, h, m = map(int, input().split())
colon = float()

h_angle = 30 * h
m_angle = 6 * m

angle = abs(h_angle - m_angle)

if angle >= 180:
    angle -= 180


colon = a ** 2 +  b ** 2  - 2 * a * b * (math.cos(math.radians(angle)))

print(math.sqrt(colon))

Fixed submission:
n = int(input())

list = []
list_hon = [2,4,5,7,9]
list_pon = [0,1,6,8]

while n > 0:
    list.append(n % 10)
    n //= 10

if list[0] in list_hon:
    print("hon")
elif list[0] in list_pon:
    print("pon")
else: #(list[0]) == 3
    print("bon")
Buggy python submission (verdict: Runtime Error):
N = int(input())
s = [input() for i in range(N)]
memo = []

for i in range(s):
    r = s.random.choice()
    if r not in memo:    
        memo.append(r)    

print(len(memo))    

Fixed submission:
N = int(input())
s = [input() for i in range(N)]

print(len(set(s)))
Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())


i = 1
s = '7'


while True:
    if k % 2 == 0:
        print('-1')
        exit()
    if int(s) % k == 0:
        print(str(i))
        exit()
    s += '7'
    i += 1


Fixed submission:
k = int(input())

if k == 1:
    print('1')
    exit()
if k % 2 == 0 or k % 5 == 0:
    print('-1')
    exit()

k *= 9
a = 10
for i in range(10*k):
    if (7 * (a - 1 + k)) % k == 0:
        print(str(i+1))
        exit()
    a = (a*10) % k