Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
from math import factorial

n = int(input())
A = list(map(int,input().split()))
dict = {}

for i,a in enumerate(A):
  if a in dict:
    dict[a].append(i)
  else:
    dict[a]=[i]

ans = 0    
    
for k,v in dict.items():
  if len(v) >= 2:
    ans += factorial(len(v)) / 2 / factorial(len(v) - 2)

#print(dict)
#print(int(ans))
#print("kk")
  
for i in range(n):
  wnum = A[i]
  l=dict[wnum]
  if 2 < len(dict[wnum]):
    print(int(ans -(factorial(len(l)) / 2 / factorial(len(l) - 2)) + factorial(len(l)-1) / 2 / factorial(len(l)-1 - 2)))
  elif 2 == len(dict[wnum]):
    print(int(ans - 1))
  else:
    print(int(ans))

Fixed submission:
from math import factorial

n = int(input())
A = list(map(int,input().split()))
dict = {}

for i,a in enumerate(A):
  if a in dict:
    dict[a].append(i)
  else:
    dict[a]=[i]

ans = 0    
    
for k,v in dict.items():
  if len(v) >= 2:
    ans += len(v) * (len(v)-1) //2
#print(ans)

  
for i in range(n):
  wnum = A[i]
  l=dict[wnum]
#  print('l',l)
  if 2 < len(dict[wnum]):
#    print(ans)
#    print('x',(len(v)-1) * (len(v)-2) // 2 )
#    print('y',len(v) * (len(v)-1) // 2 )
    print(int(ans -(len(l) * (len(l)-1) //2) + (len(l)-1) * (len(l)-2) //2))
  elif 2 == len(dict[wnum]):
    print(int(ans - 1))
  else:
    print(int(ans))

Buggy python submission (verdict: Runtime Error):
#5
#1 1 2 1 2
from math import factorial

n = int(input())
A = list(map(int,input().split()))
dict = {}

for i,a in enumerate(A):
  if a in dict:
    dict[a].append(i)
  else:
    dict[a]=[i]

ans = 0    
    
for k,v in dict.items():
  if len(v) >= 2:
    ans += factorial(len(v)) / 2 / factorial(len(v) - 2)

#print(dict)
#print(int(ans))
#print("kk")
  
for i in range(n):
  wnum = A[i]
  l=dict[wnum]
  if 2 < len(dict[wnum]):
    print(int(ans -(factorial(len(l)) / 2 / factorial(len(l) - 2)) + factorial(len(l)-1) / 2 / factorial(len(l)-1 - 2)))
  elif 2 == len(dict[wnum]):
    print(int(ans - 1))
  else:
    print(int(ans))
  

  
  

Fixed submission:
from math import factorial

n = int(input())
A = list(map(int,input().split()))
dict = {}

for i,a in enumerate(A):
  if a in dict:
    dict[a].append(i)
  else:
    dict[a]=[i]

ans = 0    
    
for k,v in dict.items():
  if len(v) >= 2:
    ans += len(v) * (len(v)-1) //2
#print(ans)

  
for i in range(n):
  wnum = A[i]
  l=dict[wnum]
#  print('l',l)
  if 2 < len(dict[wnum]):
#    print(ans)
#    print('x',(len(v)-1) * (len(v)-2) // 2 )
#    print('y',len(v) * (len(v)-1) // 2 )
    print(int(ans -(len(l) * (len(l)-1) //2) + (len(l)-1) * (len(l)-2) //2))
  elif 2 == len(dict[wnum]):
    print(int(ans - 1))
  else:
    print(int(ans))
Buggy python submission (verdict: Runtime Error):
X,A = map(input().split());

if X<A:
  print(0);
elif X>=A:
  print(10);

Fixed submission:
x, a = map(int, input().split())
 
if x < a:
    print(0)
else:
    print(10)

Buggy python submission (verdict: Runtime Error):
X,A = input();

if X<A:
  print(0);
elif X>=A:
  print(10);

Fixed submission:
x, a = map(int, input().split())
 
if x < a:
    print(0)
else:
    print(10)

Buggy python submission (verdict: Runtime Error):
X = input();
A = input();
 
if X<A:
  print(0);
elif X>=A:
  print(10);

Fixed submission:
x, a = map(int, input().split())
 
if x < a:
    print(0)
else:
    print(10)

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

if x>a:
  print(0);
else:
  print(10);



Fixed submission:
x, a = map(int, input().split())
 
if x < a:
    print(0)
else:
    print(10)

Buggy python submission (verdict: Runtime Error):
X = int(input());
A = int(input());

if X<A:
  print(0);
elif X>=A:
  print(10);
 



Fixed submission:
x, a = map(int, input().split())
 
if x < a:
    print(0)
else:
    print(10)
Buggy python submission (verdict: Runtime Error):
N = int(input())
W = list(map(int, input().split()))
 
sum_W = sum(W)
add_W = 0
 
for i in range(N):
   add_W += W[i]
   if add_W >= sum_W - add_W:
       print(min(abs(add_W - sum_W + add_W), abs(add_W - W[i] - sum_W + add_W - W[i])))
       break

Fixed submission:
i = list(map(int,input().split()));

i.sort();

print(i[0]+i[1]);

Buggy python submission (verdict: Runtime Error):
N = int(input())
W = list(map(int, input().split()))
 
sum_W = sum(W)
add_W = 0
 
for i in range(N):
   add_W += W[i]
   if add_W >= sum_W - add_W:
       print(min(abs(add_W - sum_W + add_W), abs(add_W - W[i] - sum_W + add_W - W[i])))
       break

Fixed submission:
i = list(map(int,input().split()));

i.sort();

print(i[0]+i[1]);
Buggy python submission (verdict: Runtime Error):
n = int(input());
w = list(map(int, input().split()))

sum_list = sum(w);
sum_list2 = sum_list/2;

sum_of_all = 0;
i = 0;
while sum_of_all <sum_list2:
  sum_of_all += sum_list[i];
  i=i+1;
  
print(abs((sum_list-sum_of_all)-sum_of_all))

Fixed submission:
N = int(input())
W = list(map(int, input().split()))
 
sum_W = sum(W)
add_W = 0
 
for i in range(N):
   add_W += W[i]
   if add_W >= sum_W - add_W:
       print(min(abs(add_W - sum_W + add_W), abs(add_W - W[i] - sum_W + add_W - W[i])))
       break
Buggy python submission (verdict: Runtime Error):
K,S = input().split()
K = int(K)
if len(S) <= K:
    print(S)
else:
    print(S[0:K]+"...")


Fixed submission:
K = input()
S = input()
K = int(K)
if len(S) <= K:
    print(S)
else:
    print(S[0:K]+"...")
Buggy python submission (verdict: Runtime Error):
import numpy as np
N,M = map(int,input().split())
A = np.array(list(map(int,input().split())))
output = N - np.sum(A)
if output >= 0:
    print(output)
else:
    print(-1)

Fixed submission:
import numpy as np
N,M = map(int,input().split())
A = np.array(list(map(int,input().split())))
if (output := N - np.sum(A)) >= 0:
    print(output)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
in = input()
str = list(in)

ca = str.count("A")
cb = str.count("B")

if ca == 3 or cb == 3:
  print("No")
else:
  print("Yes")


Fixed submission:
s = input()
str = list(s)
 
ca = str.count("A")
cb = str.count("B")
 
if ca == 3 or cb == 3:
  print("No")
else:
  print("Yes")

Buggy python submission (verdict: Runtime Error):
in = input()
str = list(in)

bef = str[0]
for i in range(3):
  if bef != str[i]:
    print("Yes")
    exit()
print("No")

Fixed submission:
s = input()
str = list(s)
 
ca = str.count("A")
cb = str.count("B")
 
if ca == 3 or cb == 3:
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = a*b
if c%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):
a = int(input())
b = 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):
c = a*b
if c%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):
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):
from collections import Counter
 
a = int(input())
b = [input() for _ in range(a)]
for v in ["AC", "WA", "TLE", "RE"]:
  print(f"{v} x {s.count(v)}")

Fixed submission:
from collections import Counter
 
a = int(input())
b = [input() for _ in range(a)]
for v in ["AC", "WA", "TLE", "RE"]:
  print(f"{v} x {b.count(v)}")

Buggy python submission (verdict: Runtime Error):
from collections import Counter
 
a = map(int, input())
b = Counter([input() for _ in range(a)])
for k,v in b.items():
  print(f"{k} x {v}")

Fixed submission:
from collections import Counter
 
a = int(input())
b = [input() for _ in range(a)]
for v in ["AC", "WA", "TLE", "RE"]:
  print(f"{v} x {b.count(v)}")

Buggy python submission (verdict: Runtime Error):
from collections import Counter

a = map(int, input().split())
b = Counter([input() for _ in range(a)])
for k,v in b.items():
  print(f"{k} x {v}")

Fixed submission:
from collections import Counter
 
a = int(input())
b = [input() for _ in range(a)]
for v in ["AC", "WA", "TLE", "RE"]:
  print(f"{v} x {b.count(v)}")
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
n = int(input())

a = deque(map(int,input().split()))
ans = 1
for i in range(n):
    ans = ans * a.popleft()



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

Fixed submission:
from collections import deque
import sys
n = int(input())

a = list(map(int,input().split()))
a.sort()
if(a[0] == 0):
    print("0")
    sys.exit()
ans = 1
for i in range(n):

    ans = ans * a[i]
    if(ans > 10**18):
        print("-1")
        sys.exit()
     




print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import operator
import functools
prod = functools.partial(functools.reduce, operator.mul)
n = int(input())

a = list(map(int,input().split()))
ans = prod(a)




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

Fixed submission:
from collections import deque
import sys
n = int(input())

a = list(map(int,input().split()))
a.sort()
if(a[0] == 0):
    print("0")
    sys.exit()
ans = 1
for i in range(n):

    ans = ans * a[i]
    if(ans > 10**18):
        print("-1")
        sys.exit()
     




print(ans)

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

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

ans = 1

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


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

Fixed submission:
from collections import deque
import sys
n = int(input())

a = list(map(int,input().split()))
a.sort()
if(a[0] == 0):
    print("0")
    sys.exit()
ans = 1
for i in range(n):

    ans = ans * a[i]
    if(ans > 10**18):
        print("-1")
        sys.exit()
     




print(ans)
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
a = []
b= []
while n % 2 == 0:
    b.append(2)
    n //= 2
if(len(b)!= 0):
    a.append(b)
    b= [] 
f = 3
while f * f <= n:

    if n % f == 0:
        b.append(f)
        n //= f
    else:
        f += 2
        if(len(b)!= 0):
            a.append(b)
            b= [] 

       
if(len(b)!= 0):
        a.append(b)
        b= [] 
if (n != 1 ):
    if(n == a[len(a)-1][0]):
        a[len(a)-1].append(n)
    else:
        b.append(n)
        a.append(b)

ans =0
for i in range(len(a)):
    ans += int((-1 + math.sqrt(1 + 8 * len(a[i])))/2)

print(ans)


Fixed submission:
import math
n = int(input())
a = []
b= []
while n % 2 == 0:
    b.append(2)
    n //= 2
if(len(b)!= 0):
    a.append(b)
    b= [] 
f = 3
while f * f <= n:

    if n % f == 0:
        b.append(f)
        n //= f
    else:
        f += 2
        if(len(b)!= 0):
            a.append(b)
            b= [] 

if(len(b)!= 0):
        a.append(b)
        b= [] 
if(len(a) != 0):
    if(n == a[len(a)-1][0]):
        a[len(a)-1].append(n)
        n  = 1
if (n != 1 ):
    b.append(n)
    a.append(b)

ans =0
for i in range(len(a)):
    ans += int((-1 + math.sqrt(1 + 8 * len(a[i])))/2)

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

n = int(input())
r = ['0']
for i in range(n):
    k = 0
    tmp = input()
    for j in range(len(r)):
        if(tmp == r[j]):
            k += 1
            break;
    
    if(k == 0):
        r.append(tmp)
        

print(len(r)-1)

Fixed submission:

n = int(input())
str = [input() for i in range(n)]
str.sort()
k = 1
for i in range(n-1):
    if(str[i] != str[i + 1]):
        k += 1




print(k)

Buggy python submission (verdict: Time Limit Exceeded):

n = int(input())
r = ['0']
for i in range(n):
    k = 0
    tmp = input()
    for j in range(len(r)):
        if(tmp == r[j]):
            k += 1
    
    if(k == 0):
        r.append(tmp)
        

print(len(r)-1)

Fixed submission:

n = int(input())
str = [input() for i in range(n)]
str.sort()
k = 1
for i in range(n-1):
    if(str[i] != str[i + 1]):
        k += 1




print(k)
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
a = list(map(int,input().split()))
mx = max(a)
b=[0] * mx
ans = 0
for i in range(n):
    b[a[i]-1] += 1

for i in range(mx):
    if(b[i] == 0 or b[i] == 1):
        ans += 0
    else:
        ans = ans + math.factorial(b[i])/2 / math.factorial(b[i]-2)
ans1 = 0


for i in range(n):
    ans1 = ans
    if(b[a[i]-1] >2):
        ans1 = ans1 -(math.factorial(b[a[i]-1])/2 / math.factorial(b[a[i]-1]-2)) + (math.factorial(b[a[i]-1]-1)/2 / math.factorial(b[a[i]-1]-3))
        print(int(ans1))
    elif(b[a[i]-1] == 2):
        print(int(ans1-1))
    elif(b[a[i]-1] < 2):
        print(int(ans1))

Fixed submission:
import math
n = int(input())
a = list(map(int,input().split()))
mx = max(a)
b=[0] * 2000000
ans = 0
for i in range(len(a)):
    b[a[i]-1] += 1

for i in range(mx):
    if(b[i] == 0 or b[i] == 1):
        ans += 0
    else:
        ans = ans + int(b[i] * (b[i]-1)/2)
ans1 = 0


for i in range(len(a)):
    ans1 = ans
    if(b[a[i]-1] >2):
        ans1 = ans1 -int((b[a[i]-1]*(b[a[i]-1]-1))/2) + int(((b[a[i]-1]-1) * (b[a[i]-1]-2))/2)
        print(int(ans1))
    elif(b[a[i]-1] == 2):
        print(int(ans1-1))
    elif(b[a[i]-1] < 2):
        print(int(ans1))

Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
a = list(map(int,input().split()))
mx = max(a)
b=[0] * mx
ans = 0
for i in range(n):
    b[a[i]-1] += 1

for i in range(mx):
    if(b[i] == 0 or b[i] == 1):
        ans += 0
    else:
        ans = ans + math.factorial(b[i])/2 / math.factorial(b[i]-2)
ans1 = 0


for i in range(n):
    ans1 = ans -(math.factorial(b[a[i]-1])/2 / math.factorial(b[a[i]-1]-2))
    if(b[a[i]-1]-1 < 2):
        print(int(ans1))
    else:
        ans1 = ans1 + (math.factorial(b[a[i]-1]-1)/2 / math.factorial(b[a[i]-1]-3))
        print(int(ans1))

Fixed submission:
import math
n = int(input())
a = list(map(int,input().split()))
mx = max(a)
b=[0] * 2000000
ans = 0
for i in range(len(a)):
    b[a[i]-1] += 1

for i in range(mx):
    if(b[i] == 0 or b[i] == 1):
        ans += 0
    else:
        ans = ans + int(b[i] * (b[i]-1)/2)
ans1 = 0


for i in range(len(a)):
    ans1 = ans
    if(b[a[i]-1] >2):
        ans1 = ans1 -int((b[a[i]-1]*(b[a[i]-1]-1))/2) + int(((b[a[i]-1]-1) * (b[a[i]-1]-2))/2)
        print(int(ans1))
    elif(b[a[i]-1] == 2):
        print(int(ans1-1))
    elif(b[a[i]-1] < 2):
        print(int(ans1))
Buggy python submission (verdict: Runtime Error):
import sys
n = int(input())
s = input()
a = int(len(s)/2)

if(len(a)%2 == 1):
  print("No")
  sys.exit()

for i in range(a):
  if(s[i] != s[i + a]):
    print("No")
    sys.exit()
    
print("Yes")
    
    


Fixed submission:
import sys
n = int(input())
s = input()
d = int(n/2)
if(len(s)%2 == 1):
    print("No")
    sys.exit()
else:
    for i in range(d):
        if(s[i] != s[i + d]):
            print("No")
            sys.exit()

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

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

if(a > 9 or b > 9):
    print("-1")
else:

    print(a*b)
Buggy python submission (verdict: Runtime Error):
import math
import itertools
n = int(input())

if(n %2 == 1):
    d = int((n-1)/2) + 1
else:
    d = int(n/2)

ans = d/n

print(f'{ans:.08f}')

Fixed submission:
import math
import itertools
n = int(input())
 
if(n %2 == 1):
    d = int((n-1)/2) + 1
else:
    d = int(n/2)
 
ans = d/n
 
print('{:.08f}'.format(ans))
Buggy python submission (verdict: Runtime Error):
num = int(input)
count = {"AC":0, "WA":0, "TLE":0, "RE":0}

for i in range(num):
  word = input()
  for (key , n) in count.items():
    if word == key:
      n += 1
 
for (key , n) in count.items():
  print(key + " × " + str(n))

Fixed submission:
num = int(input())
count = {"AC":0, "WA":0, "TLE":0, "RE":0}
 
for i in range(num):
  word = input()
  for (key , n) in count.items():
    if word == key:
      count[key] += 1
 
for (key , n) in count.items():
  print(key + " x " + str(n))
Buggy python submission (verdict: Runtime Error):
import math

a,b=map(int,input().split())
print(a*b//math.gcd(a,b))

Fixed submission:
import fractions

a,b=map(int,input().split())
print(a*b//fractions.gcd(a,b))
Buggy python submission (verdict: Runtime Error):
n,m=map(int, input().split())

ka=[]
for i in range(n):
    atmp=list(input().split())
    ka.append(atmp)


like=ka[0][1::]
ans=len(like)

if n>1:
    for i in range(1,n):
        liketmp=ka[i][1::]
        for k in range(0,len(like)):
             if like[k] not in liketmp:
                 if ans>0:
                     ans-=1
                     del like[k]
                     if ans==0:
                         break

print(ans)


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

ka=[]
ans=0

for i in range(n):
    atmp=list(input().split())
    ka.append(atmp)


like=ka[0][1::]

if n>1:
    for i in range(1,n):
        liketmp=ka[i][1::]
        for k in range(0,len(like)):
            if like[k] not in liketmp:
                     like[k]='0'

for j in range(len(like)):
    if like[j]!='0':
        ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
x=[int(i) for i in input().split()]
if m==1 or n>m
    print(0)
else:
    x=sorted(x)

    if n==1:
        print(x[-1]-x[0])
    else:

        xsa=[]
        for i in range(len(x)-1):
            xsa.append(x[i+1]-x[i])

        xsa=sorted(xsa)

        print(sum(xsa[0:(m-n)]))


Fixed submission:
n,m=map(int,input().split())
x=[int(i) for i in input().split()]
if m==1 or n>m:
    print(0)
else:
    x=sorted(x)

    if n==1:
        print(x[-1]-x[0])
    else:

        xsa=[]
        for i in range(len(x)-1):
            xsa.append(x[i+1]-x[i])

        xsa=sorted(xsa)



        print(sum(xsa[0:(m-n)]))
Buggy python submission (verdict: Runtime Error):
N,T=map(int,input().split())

C=[]

for i in range(N):
    c,t=map(int,input().split())

    if t<=T:
        C.append(c)

print(min(C))


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

C=[]

for i in range(N):
    c,t=map(int,input().split())

    if t<=T:
        C.append(c)

if not C:
    print('TLE')
else:
    print(min(C))

Buggy python submission (verdict: Runtime Error):
N=int(input())
T=int(input())
check=1
ansc=1001

for i in range(N):
    c=int(input())
    t=int(input())

    if t<T and c<ansc:
        ansc=c
        T=t
        check=0

if check==0:
    print(ansc)
else:
    print('TLE')

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

C=[]

for i in range(N):
    c,t=map(int,input().split())

    if t<=T:
        C.append(c)

if not C:
    print('TLE')
else:
    print(min(C))
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=0
ntmp=n

for i in range(0,9):
    if ntmp>=10**i:
        s+=int((ntmp%10**(i+1))/10**i)
        ntmp-=ntmp%10**(i+1)
    else:
        break

if n%s:
    print('No')
else:
    print('Yes')


Fixed submission:
n=int(input())
s=0
ntmp=n

for i in range(0,10):
    if ntmp>=10**i:
        s+=int((ntmp%10**(i+1))/10**i)
        ntmp-=ntmp%10**(i+1)
    else:
        break

if n%s:
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Runtime Error):
s=input();t=input()
s=sorted(s)
t=sorted(t)
tnew=[]

for i in range(len(t)-1,-1,-1):
    #print(i)
    tnew.append(t[i])
cnt=0

for i in range(len(s)):
    if s[i]<tnew[i]:
        print('Yes')
        cnt=1
        break
    if s[i]>tnew[i]:
        print('No')
        cnt=1
        break

if cnt==0:
    if len(tnew)>len(s):
        print('Yes')
    else:
        print('No')

Fixed submission:
s=input();t=input()
s=sorted(s)
t=sorted(t)
tnew=[]

for i in range(len(t)-1,-1,-1):
    #print(i)
    tnew.append(t[i])
cnt=0

if len(s)<=len(t):
    L=len(s)
else:
    L=len(t)


for i in range(L):
    if s[i]<tnew[i]:
        print('Yes')
        cnt=1
        break
    if s[i]>tnew[i]:
        print('No')
        cnt=1
        break

if cnt==0:
    if len(tnew)>len(s):
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
N = input()
M = int(N)

def cal(a):
	return a%1000

 
if M=1000
  print(0)


else:
	print(1000-cal(M))




Fixed submission:
N = input()
M = int(N)
 
def cal(a):
	return a%1000
 
 
if M % 1000==0:
  print(0)
 
 
else:
	print(1000-cal(M))

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

def cal(a):
	return a%1000

 
if M=1000
  print(0)


print(1000-cal(M))




Fixed submission:
N = input()
M = int(N)
 
def cal(a):
	return a%1000
 
 
if M % 1000==0:
  print(0)
 
 
else:
	print(1000-cal(M))
Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce

from operator import mul

N=int(input())

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

if 10**18>=reduce(mul,list):
	print(reduce(mul,list))

else:
  	print("-1")

Fixed submission:
def main ():
	N = int(input())
	A = list(map(int,input(). split ()))
	if 0 in A:
		print(0)
		return
	prod = 1
	for a in A:
		prod *= a
		if prod > 1000000000000000000:
			print(-1)
			return
	print(prod)

main ()

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

from operator import mul

N=int(input())

list=list(map(int,input().split()))
a=reduce(mul,list)

if 10**18>=a:
	print(a)
else:
  	print("-1")

Fixed submission:
def main ():
	N = int(input())
	A = list(map(int,input(). split ()))
	if 0 in A:
		print(0)
		return
	prod = 1
	for a in A:
		prod *= a
		if prod > 1000000000000000000:
			print(-1)
			return
	print(prod)

main ()

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

from operator import mul

N=int(input())

list=list(map(int,input().split()))
a=reduce(mul,list)

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

Fixed submission:
def main ():
	N = int(input())
	A = list(map(int,input(). split ()))
	if 0 in A:
		print(0)
		return
	prod = 1
	for a in A:
		prod *= a
		if prod > 1000000000000000000:
			print(-1)
			return
	print(prod)

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

N1=N%10

if N1=2,4,5,7,9:
	print(hon)
elif N1=0,1,6,8:
	print(pon)
else:
  	print(bon)


Fixed submission:
N= int(input())
 
N1=N%10
 
if N1==2:
	print("hon")
elif N1==4:
	print("hon")
elif N1==5:
	print("hon")
elif N1==7:
	print("hon")
elif N1==9:
	print("hon")
elif N1==0:
	print("pon")
elif N1==1:
	print("pon")
elif N1==6:
	print("pon")
elif N1==8:
	print("pon")
else:
  	print("bon")
Buggy python submission (verdict: Runtime Error):
a = int(input())
list=list(map(int,input().split()))

b=list[0]//a
c=list[1]//a

if list[1]%a==0
	print("OK")

elif c-b>=1:
	print("OK")

else:
  print("NG")


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

b=list[0]//a
c=list[1]//a

if list[0]%a==0:
	print("OK")

elif c-b>=1:
	print("OK")

else:
  print("NG")
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())

if a>b
	print("safe")

else:
	print("unsafe")

Fixed submission:
a,b=map(int,input().split())
 
if a>b:
	print("safe")
 
else:
	print("unsafe")