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

x,y=list(map(int,input().split()))
mod = 10 ** 9 + 7

if (2 * y - x) % 3 != 0 or (2 * x - y) % 3 != 0:
  print("0")
  exit()
  
a,b = (2 * y - x) // 3, (2 * x - y) // 3 

r = min(a,b)

if r == 0:
  print("1")
else:
  numerator = reduce(lambda x, y: x * y % mod, [a + b - r + k + 1 for k in range(r)])
  denominator = reduce(lambda x, y: x * y % mod, [k + 1 for k in range(r)])
  print(numerator * pow(denominator, mod - 2, mod) % mod)

Fixed submission:
from functools import reduce

x,y=list(map(int,input().split()))
mod = 10 ** 9 + 7

if (2 * y - x) % 3 != 0 or (2 * x - y) % 3 != 0:
  print("0")
  exit()
  
a,b = (2 * y - x) // 3, (2 * x - y) // 3 

r = min(a,b)

if r == 0:
  print("1")
elif r < 0:
  print("0")
else:
  numerator = reduce(lambda x, y: x * y % mod, range(a + b - r + 1, a + b + 1))
  denominator = reduce(lambda x, y: x * y % mod, range(1,r + 1))
  print(numerator * pow(denominator, mod - 2, mod) % mod)

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

x,y=list(map(int,input().split()))
mod = 10 ** 9 + 7

if (2 * y - x) % 3 != 0 or (2 * x - y) % 3 != 0:
  print("0")
  exit()
  
a,b = (2 * y - x) // 3, (2 * x - y) // 3 

r = min(a,b)

numerator = reduce(lambda x, y: x * y % mod, [a + b - r + k + 1 for k in range(r)])
denominator = reduce(lambda x, y: x * y % mod, [k + 1 for k in range(r)])
print(numerator * pow(denominator, mod - 2, mod) % mod)

Fixed submission:
from functools import reduce

x,y=list(map(int,input().split()))
mod = 10 ** 9 + 7

if (2 * y - x) % 3 != 0 or (2 * x - y) % 3 != 0:
  print("0")
  exit()
  
a,b = (2 * y - x) // 3, (2 * x - y) // 3 

r = min(a,b)

if r == 0:
  print("1")
elif r < 0:
  print("0")
else:
  numerator = reduce(lambda x, y: x * y % mod, range(a + b - r + 1, a + b + 1))
  denominator = reduce(lambda x, y: x * y % mod, range(1,r + 1))
  print(numerator * pow(denominator, mod - 2, mod) % mod)
Buggy python submission (verdict: Runtime Error):
a,b=list(map(input().split()))
if a>9 or b>9:
  print("-1")
else:
  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):
def Judge(n):
  n=int(input())
  for i in range(1,10):
    if n % i == 0 and n // i < 10:
      return "Yes"
  return "No"

n=int(input())
print(Judge(n))

Fixed submission:
def Judge(n):
  for i in range(1,10):
    if n % i == 0 and n // i < 10:
      return "Yes"
  return "No"
 
n=int(input())
print(Judge(n))
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=[0 for _ in range(n)]
for i in range(n):
  b[a[i]-1] = i+1
print(''.join(b))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=[0 for _ in range(n)]
for i in range(n):
  b[a[i]-1] = i+1
for j in range(n):
  print(b[j])
Buggy python submission (verdict: Runtime Error):
s=input()
weather=['Sunny','Cloudy','Rainy']
print(weather[weather.index(s)+1])

Fixed submission:
s=input()
weather=['Sunny','Cloudy','Rainy','Sunny']
print(weather[weather.index(s)+1])
Buggy python submission (verdict: Runtime Error):
n,m=list(map(int, input().split()))
a=list(map(int,input().split()))
while m>0:
  a.sort(reverse=True)
  for _ in range(m):
    a[0] //= 2
    m -= 1
    if a[0] < a[1]:
      break
  if a[0] == 0:
    break
print(sum(a))

Fixed submission:
n,m=list(map(int, input().split()))
a=list(map(int, input().split()))
a.sort(reverse=True)
while m>0:
  a[0] //= 2
  m = m - 1
  for i in range(n-1):
    if a[0] < a[i+1] and m > 0:
      a[i+1] //= 2
      m = m - 1
    else:
      a.sort(reverse=True)
      break
print(sum(a))

Buggy python submission (verdict: Time Limit Exceeded):
n,m=list(map(int, input().split()))
a=list(map(int,input().split()))
while m>0:
  a.sort()
  for _ in range(m):
    a[n-1] //= 2
    m -= 1
    if a[n-1] < a[n-2]:
      break
print(sum(a))

Fixed submission:
n,m=list(map(int, input().split()))
a=list(map(int, input().split()))
a.sort(reverse=True)
while m>0:
  a[0] //= 2
  m = m - 1
  for i in range(n-1):
    if a[0] < a[i+1] and m > 0:
      a[i+1] //= 2
      m = m - 1
    else:
      a.sort(reverse=True)
      break
print(sum(a))

Buggy python submission (verdict: Time Limit Exceeded):
n,m=list(map(int, input().split()))
a=list(map(int,input().split()))
for _ in range(m):
  a.sort()
  a[n-1] //= 2
print(sum(a))

Fixed submission:
n,m=list(map(int, input().split()))
a=list(map(int, input().split()))
a.sort(reverse=True)
while m>0:
  a[0] //= 2
  m = m - 1
  for i in range(n-1):
    if a[0] < a[i+1] and m > 0:
      a[i+1] //= 2
      m = m - 1
    else:
      a.sort(reverse=True)
      break
print(sum(a))

Buggy python submission (verdict: Runtime Error):
n,m=list(map(int, input().split()))
a=list(map(int,input().split()))
for _ in range(m):
  a.sort()
  a[m-1] //= 2
print(sum(a))

Fixed submission:
n,m=list(map(int, input().split()))
a=list(map(int, input().split()))
a.sort(reverse=True)
while m>0:
  a[0] //= 2
  m = m - 1
  for i in range(n-1):
    if a[0] < a[i+1] and m > 0:
      a[i+1] //= 2
      m = m - 1
    else:
      a.sort(reverse=True)
      break
print(sum(a))

Buggy python submission (verdict: Time Limit Exceeded):
n,m=list(map(int, input().split()))
a=list(map(int,input().split()))
for _ in range(m):
  a[a.index(max(a))] = max(a) // 2
print(sum(a))

Fixed submission:
n,m=list(map(int, input().split()))
a=list(map(int, input().split()))
a.sort(reverse=True)
while m>0:
  a[0] //= 2
  m = m - 1
  for i in range(n-1):
    if a[0] < a[i+1] and m > 0:
      a[i+1] //= 2
      m = m - 1
    else:
      a.sort(reverse=True)
      break
print(sum(a))
Buggy python submission (verdict: Runtime Error):
a, b = list(map(int, input().split))
ans = 0;
sum = a;
while sum < b:
  sum += (a-1)
  ans++
print(ans)

Fixed submission:
a, b = list(map(int, input().split()))
ans = 0;
sum = 1;
while sum < b:
  sum += (a-1)
  ans = ans + 1
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
d=sorted(list(map(int,input().split())))
print(d[n/2]-d[n/2-1])

Fixed submission:
n=int(input())
d=sorted(list(map(int,input().split())))
print(d[n//2]-d[n//2-1])
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

n=int(input())
lis=[list(map(int,input().split())) for _ in range(2)]
ans=0

for li in itertools.product([0,1], repeat=n):
  v=0
  for id,l in enumerate(li):
    if l:
      v += lis[0][id] - lis[1][id]
      
  if v > ans:
    ans=v
    
print(ans)

Fixed submission:
import itertools

n=int(input())
lis=[list(map(int,input().split())) for _ in range(2)]
ans=0

for li in itertools.product([0,1], repeat=n):
  v=0
  for id,l in enumerate(li):
    if l:
      v += lis[0][id] - lis[1][id]
      
  if v > ans:
    ans=v
    
print(ans)
Buggy python submission (verdict: Runtime Error):
import math

li=[int(input()) for _ in range(5)]
m,last,ans=10,li[0],0

for i in range(5):
  l = li[i]
  if 0 < l % 10 < m :
    m = l % 10
    last = l
    lm = i

for i in range(5):
  l=li[i]
  if l == last and i == lm:
    ans += l
  else:
    ans += math.ceil(l/10)*10
    
print(ans)

Fixed submission:
import math

li=[int(input()) for _ in range(5)]
m,last,ans,lm=10,li[0],0,0

for i in range(5):
  l = li[i]
  if 0 < l % 10 < m :
    m = l % 10
    last = l
    lm = i

for i in range(5):
  l=li[i]
  if l == last and i == lm:
    ans += l
  else:
    ans += math.ceil(l/10)*10
    
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
numx,numy,numz,k=list(map(int,input().split()))
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
Z=list(map(int,input().split()))

XY=[ x + y for x in X for y in Y]
XY.sort(reverse=True)
XY=XY[:k]
XYZ=[xy + z for xy in XY for z in Z]
XYZ.sort(reverse=True)

for i in range(k):
  print(XYZ[i])

Fixed submission:
numx,numy,numz,k=list(map(int,input().split()))
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
Z=list(map(int,input().split()))

XY=[ x + y for x in X for y in Y]
XY.sort(reverse=True)
XY=XY[:k]
XYZ=[xy + z for xy in XY for z in Z]
XYZ.sort(reverse=True)

for i in range(k):
  print(XYZ[i])
Buggy python submission (verdict: Runtime Error):
S=input()
sum,ans=0,[]

for s in S:
  if s in "ACGT":
    sum += 1
  else:
    ans.append(sum)
    sum = 0
print(max(max(ans),sum))

Fixed submission:
S=input()
sum,ans=0,[0]

for s in S:
  if s in "ACGT":
    sum += 1
  else:
    ans.append(sum)
    sum = 0
print(max(max(ans),sum))
Buggy python submission (verdict: Runtime Error):
import itertools
import math

d,g=list(map(int,input().split()))
PC=[list(map(int,input().split())) for _ in range(d)]
ans=[]

for i in range(d):
  for j in itertools.combinations(range(d),i):
    score,pro1=0,0
    for k in j:
      score += (PC[k][1] + (k+1) * 100 * PC[k][0])
      pro1 += PC[k][0]
    for k in range(d):
      pro2 = pro1
      if score >= g:
        ans.append(pro2)
      elif k in j:
        continue
      p=math.ceil((g-score) / ((k+1) * 100))
      if 0 < p < PC[k][0]:
        pro2 += p
        ans.append(pro2)
        
print(min(ans))

Fixed submission:
import itertools
import math

d,g=list(map(int,input().split()))
PC=[list(map(int,input().split())) for _ in range(d)]
ans=[]

for i in range(d+1):
  for j in itertools.combinations(range(d),i):
    score,pro1=0,0
    for k in j:
      score += (PC[k][1] + (k+1) * 100 * PC[k][0])
      pro1 += PC[k][0]
    for k in range(d):
      pro2 = pro1
      if score >= g:
        ans.append(pro2)
      elif k in j:
        continue
      p=math.ceil((g-score) / ((k+1) * 100))
      if 0 < p < PC[k][0]:
        pro2 += p
        ans.append(pro2)
        
print(min(ans))
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = int(input())
if n <= 8 and p<= 8:
  print('Yay!')
else:
  print(':(')

Fixed submission:
a, b = map(int, input().split())
if a<=8 and b<=8:
  print("Yay!")
else:
  print(":(")

Buggy python submission (verdict: Runtime Error):
n = int(input())
p = int(input())
if n <= 8 and p<= 8:
    print('Yay!')
else:
    print(':(')

Fixed submission:
a, b = map(int, input().split())
if a<=8 and b<=8:
  print("Yay!")
else:
  print(":(")
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
B.sort()
BC,ans=[0 for _ in range(n)],0
C=list(map(int,input().split()))
C.sort()

for i in range(n):
  left,right=-1,n
  
  while right - left > 1:
    mid = (left + right) // 2
    
    if B[mid] > A[i]:
      right = mid
    else:
      left = mid
  k = right
  
  for j in range(k,n):
    if BC[j]:
      ans += BC[j]
      continue
    
    left,right=-1,n
    
    while right - left > 1:
      mid = (left + right) // 2
      
      if C[mid] > B[j]:
        right = mid
      else:
        left = mid
        
    ans += (n - right)
    BC[j] = n - right
    
print(ans)

Fixed submission:
from bisect import bisect_left, bisect_right

n,ans=int(input()),0

A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))

A.sort()
C.sort()

for b in B:
  j = bisect_left(A,b)
  k = bisect_right(C,b)
  ans += j*(n-k)
  
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

n,k=list(map(int,input().split()))
A=list(map(int,input().split()))
li=[i for i in range(1,n)]
ans=[]

for i in itertools.permutations(li, k-1):
  cost,height=0,A[0]
  for j in i:
    if height < A[j]:
      height=A[j]
      continue
    cost += (height-A[j]+1)
    height += 1 
  ans.append(cost)
  
print(min(ans))

Fixed submission:
import itertools

n,k=list(map(int,input().split()))
A=list(map(int,input().split()))
ans=[]

for li in itertools.product([0,1], repeat=n-1):
  if li.count(1) < k-1:
    continue
  cost,height=0,A[0]
  for i in range(1,n):
    if height < A[i]:
      height=A[i]
      continue
    if li[i-1]:
      cost += (height-A[i]+1)
      height += 1 
  ans.append(cost)
  
print(min(ans))
Buggy python submission (verdict: Runtime Error):
a,b=list(map(int,input().split()))
if a>b:
  print("Alice")
elif a=b:
  print("Draw")
else:
  print("Bob")

Fixed submission:
a,b=list(map(int,input().split()))
if a == 1:
  a += 13
if b == 1:
  b += 13

if a > b:
  print("Alice")
elif a==b:
  print("Draw")
else:
  print("Bob")
Buggy python submission (verdict: Runtime Error):
N, H = tuple(map(int, input().split(' ')))
katanas = [list(map(int, input().split(' '))) for _ in range(0, N)]

normaldmbs = list(map(lambda x: x[0], katanas))
max_normal_dmg = max(normaldmbs)

throwables = list(map(lambda x: x[1], filter(lambda x: x[1] > max_normal_dmg, katanas)))
throwables.sort().reverse()

cnt = 0

for v in throwables:
    H -= v
    cnt += 1
    if H <= 0:
        break

if H > 0:
    if H % max_normal_dmg == 0:
        cnt += int(H / max_normal_dmg)
    else:
        cnt += int(H / max_normal_dmg) + 1


print(cnt)

Fixed submission:
N, H = tuple(map(int, input().split(' ')))
katanas = [list(map(int, input().split(' '))) for _ in range(0, N)]

normaldmbs = list(map(lambda x: x[0], katanas))
max_normal_dmg = max(normaldmbs)

throwables = list(map(lambda x: x[1], filter(lambda x: x[1] > max_normal_dmg, katanas)))
throwables.sort(reverse=True)

cnt = 0

for v in throwables:
    H -= v
    cnt += 1
    if H <= 0:
        break

if H > 0:
    if H % max_normal_dmg == 0:
        cnt += int(H / max_normal_dmg)
    else:
        cnt += int(H / max_normal_dmg) + 1


print(cnt)
Buggy python submission (verdict: Runtime Error):
N, K = tuple(map(int ,input().split(' ')))

print( K * int(power(float(K), float(N - 1))) )

Fixed submission:
N, K = tuple(map(int ,input().split(' ')))
 
print( K * int(pow(float(K - 1), float(N - 1))) )
Buggy python submission (verdict: Time Limit Exceeded):
from math import factorial
import collections
def cmb(n,r):
  if n-r<0:
    return 0
  return factorial(n) // factorial(r) // factorial(n - r)
n=int(input())
a=list(map(int,input().split()))
ccc=[]
for i in range(n):
  ccc.append(cmb(i,2))

c=collections.Counter(a)
for aa in a:
  o=0
  for k,v in c.items():
    if aa==k:
      v-=1
    o+=ccc[v]
  print(o)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
数え=[0]*N
for i in A:
  数え[i-1]+=1
前者=0
for i in 数え:
  前者+=i*(i-1)//2
for i in A:
  後者=数え[i-1]-1
  print(前者-後者)

Buggy python submission (verdict: Time Limit Exceeded):
from math import factorial
import collections
import copy
def cmb(n,r):
  if n-r<0:
    return 0
  return factorial(n) // factorial(r) // factorial(n - r)
n=int(input())
a=list(map(int,input().split()))
ccc=[]
for i in range(n):
  ccc.append(cmb(i,2))

c=collections.Counter(a)
for aa in a:
  t=copy.copy(c)
  o=0
  t[aa]-=1
  for i in t.values():
    o+=ccc[i]
  print(o)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
数え=[0]*N
for i in A:
  数え[i-1]+=1
前者=0
for i in 数え:
  前者+=i*(i-1)//2
for i in A:
  後者=数え[i-1]-1
  print(前者-後者)

Buggy python submission (verdict: Time Limit Exceeded):
from math import factorial
import collections
import copy
def cmb(n,r):
  if n-r<0:
    return 0
  return factorial(n) // factorial(r) // factorial(n - r)
n=int(input())
a=list(map(int,input().split()))
c=collections.Counter(a)
for aa in a:
  t=copy.copy(c)
  o=0
  t[aa]-=1
  for i in t.values():
    o+=cmb(i,2)
  print(o)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
数え=[0]*N
for i in A:
  数え[i-1]+=1
前者=0
for i in 数え:
  前者+=i*(i-1)//2
for i in A:
  後者=数え[i-1]-1
  print(前者-後者)
Buggy python submission (verdict: Time Limit Exceeded):
s=list(input())
for i in range(int(input())):
  a=input().split()
  if a[0]=="1":
    s=s[::-1]
  elif a[1]=="2":
    s.append(a[2])
  else:
    s.insert(0,a[2])
print("".join(s))

Fixed submission:
from collections import deque
s=deque(input().split())
f=False
for i in range(int(input())):
  _=input().split()
  if _[0]=='1':
    f=not f
  elif _[1]=='1':
    if f:
      s.append(_[2])
    else:
      s.appendleft(_[2])
  else:
    if f:
      s.appendleft(_[2])
    else:
      s.append(_[2])
print("".join(s)[::-1] if f else "".join(s))
Buggy python submission (verdict: Runtime Error):
input()
a=list(map(int,input().split()))
print(' '.join([str(i[0]) for i in sorted([[i+1,a[i]]for i in range(0,len(a))],key=lambda x: x[1])]))

Fixed submission:
input()
a=list(map(int,input().split()))
print(' '.join([str(i[0]) for i in sorted([[i+1,a[i]]for i in range(0,len(a))],key=lambda x: x[1])]))
Buggy python submission (verdict: Runtime Error):
10 13 15
3
1
4
1
5
9
2
6
5
3
5
8
9
7
9

Fixed submission:
#!/usr/bin/env python3
a,b,c=map(int,input().split())
d=[b]*a
for i in[int(input())-1for _ in range(0,c)]:d[i]+=1
for i in d:print("Yes")if i-c>0 else print("No")
Buggy python submission (verdict: Time Limit Exceeded):
a=0
d=["".join(sorted(input()))for i in range(int(input()))]
for i in list(set(d)):
  n=d.count(i)
  a+=(n-1)*n
print(int(a/2))

Fixed submission:
from collections import *
print(int(sum(([(i-1)*i/2 for i in Counter(["".join(sorted(input()))for i in range(int(input()))]).values()]))))

Buggy python submission (verdict: Time Limit Exceeded):
d,a=[],0
for i in range(0,int(input())):
  d.append("".join(sorted(input().rstrip('\n'))))
for i in list(set(d)):
  n=d.count(i)
  a+=(n-1)*n
print(int(a/2))

Fixed submission:
from collections import *
print(int(sum(([(i-1)*i/2 for i in Counter(["".join(sorted(input()))for i in range(int(input()))]).values()]))))

Buggy python submission (verdict: Time Limit Exceeded):
d,a=[],0
for i in range(0,int(input())):
  d.append("".join(sorted(input().rstrip('\n'))))
for i in list(set(d)):
  n=d.count(i)
  a+=(n-1)*n
print(int(a/2))

Fixed submission:
from collections import *
print(int(sum(([(i-1)*i/2 for i in Counter(["".join(sorted(input()))for i in range(int(input()))]).values()]))))
Buggy python submission (verdict: Runtime Error):
list(combinations([i for i in range(_[0],_[1]+1)],2)if _[1]-_[0]<2019else combinations([i for i in range(_[0],_[0]+2020)],2))

Fixed submission:
from itertools import combinations
_=list(map(int,input().split()))
a=list(combinations([i for i in range(_[0],_[1]+1)],2) if _[1]-_[0]<2019 else combinations([i for i in range(_[0],_[0]+2020)],2))
print(min([i[0]*i[1]%2019 for i in list(a)]))
Buggy python submission (verdict: Runtime Error):
input();a=0
print([sorted(i)[1]==i[1]for i in [list(map(int,input().split()))[i:i+3] for i in range(len(list(map(int,input().split())))-4)]].count(True))

Fixed submission:
#gets;a=0
#gets.split.map(&:to_i).each_cons(3){|_|a+=_.sort[1]==_[1]?1:0}
#p a

def each_cons(x, size):
    return [x[i:i+size] for i in range(len(x)-size+1)]
input();a=0
print([sorted(i)[1]==i[1]for i in each_cons(list(map(int,input().split())),3)].count(True))
Buggy python submission (verdict: Runtime Error):
n=int(input())
t=input()
d=[len(list(set(list(t[:i]))&set(list(t[i:])))) for i in range(1,n-1)]
print(max(d))

Fixed submission:
n=int(input())
t=input()
d=[len(list(set(list(t[:i]))&set(list(t[i:])))) for i in range(1,n-1)]
try:
  print(max(d))
except:
  print(0)
Buggy python submission (verdict: Runtime Error):
a =  int(input())
if a == 0:
  print(0)
  return
r = 1000 - (a % 1000)
print(r)

Fixed submission:
a =  int(input())
print((1000 - a % 1000) % 1000)
Buggy python submission (verdict: Runtime Error):
t = int(input())
list_v = list(map(int,input().split()))
 
res = 1
if 0 in list_v:
  res = 0
else:
  for v in list_v:
    res *= v
    if res > 10**18:
      res = -1
      break
print(res)

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

Buggy python submission (verdict: Runtime Error):
t = int(input())
list_v = list(map(int,input().split()))
 
res = 1
for v in list_v:
  if v == 0:
    res = 0
    break
  res *= v
  if res > 10**18:
    res = -1
    break
print(res)

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

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

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

Buggy python submission (verdict: Runtime Error):
a, b = input()
print(a*b)

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

Buggy python submission (verdict: Runtime Error):
t1 = int(input())
t2 = int(input())
print(t1*t2)

Fixed submission:
a, b = map(int, input().split())
print(a*b)
Buggy python submission (verdict: Runtime Error):
t = int(input())
list_v = list(map(int,input().split()))
 
res = 1
for v in list_v:
  if v == 0:
    return 0
  res = res * v
  if res > 10**18:
    res = -1
    break
print(res)

Fixed submission:
t = int(input())
list_v = list(map(int,input().split()))
 
res = 1
if 0 in list_v:
  res = 0
else:
  for v in list_v:
    res *= v
    if res > 10**18:
      res = -1
      break
print(res)

Buggy python submission (verdict: Runtime Error):
t = int(input())
list_v = list(map(int,input().split()))

res = 1
for v in list_v:
  if v = 0:
    return 0
  res = res * v
  if res > 10**18:
    res = -1
    break
print(res)

Fixed submission:
t = int(input())
list_v = list(map(int,input().split()))
 
res = 1
if 0 in list_v:
  res = 0
else:
  for v in list_v:
    res *= v
    if res > 10**18:
      res = -1
      break
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
t = int(input())
list_v = [int(x) for x in input().split()]

res = 1
for v in list_v:
  res = res * v
 
if res > 1000000000000000000:
	print(-1)
else:
	print(res)

Fixed submission:
t = int(input())
list_v = list(map(int,input().split()))
 
res = 1
if 0 in list_v:
  res = 0
else:
  for v in list_v:
    res *= v
    if res > 10**18:
      res = -1
      break
print(res)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
print(a*b)

Fixed submission:
a, b =  input().split()
a = int(a)
b = int(b.replace('.', ''))
print(int(a * b // 100))
Buggy python submission (verdict: Runtime Error):
S = print()
if str(T) == str(S) + 1
 input(Yes)
else input(No)

Fixed submission:
s = input()
t = input()
if s == t[:-1]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = input()
c = input()
d = input()
e = int(input()
k = input()
if e - a <= k:
    print("Yay!")
else:
    print(":(")


Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if e - a <= k:
    print("Yay!")
else:
    print(":(")

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = input()
c = input()
d = input()
e = int(input())
k = input()
x = e-a
if x <= k:
    print("Yay!")
else:
    print(":(")


Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if e - a <= k:
    print("Yay!")
else:
    print(":(")
Buggy python submission (verdict: Runtime Error):
n = input()
if n >= 1000:
    print("ABD")
else:
    print("ABC")

Fixed submission:
n = int(input())
if n >= 1000:
    print("ABD")
else:
    print("ABC")
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
a = o
for i in len(S):
  if S[i] != T[i]:
    a += 1
print(a)
    

Fixed submission:
S = input()
T = input()
a = 0
for i in range(len(S)):
  if S[i] != T[i]:
    a += 1
print(a)
Buggy python submission (verdict: Runtime Error):
N = int(input())
K = int(input())
a = 1
for i in range(N):
  if a < K:
    a *= 2:
  else:
    a += K
print(a)

Fixed submission:
N = int(input())
K = int(input())
a = 1
for i in range(N):
  if a < K:
    a *= 2
  else:
    a += K
print(a)