Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
x,y=input().split()
if x=="A":x=10
elif x=="B":X=11
elif x=="C":x=12
elif x=="D":x=13
elif x=="E":x=14
elif x=="F":x=15
if y=="A":y=10
elif y=="B":y=11
elif y=="C":y=12
elif y=="D":y=13
elif y=="E":y=14
elif y=="F":y=15
if x-y<0:print("<")
elif x-y>0:print(">")
elif x-y==0:print("=")

Fixed submission:
x,y=input().split()
lis=["A","B","C","D","E","F"]
for i in range(6):
    if x==lis[i]:x=i+10
    if y==lis[i]:y=i+10
if x<y:print("<")
elif x>y:print(">")
elif x==y:print("=")

Buggy python submission (verdict: Runtime Error):
x,y=input().split()
if x=="A":
    x=10
if x=="B":
    X=11
if x=="C":
    x=12
if x=="D":
    x=13
if x=="E":
    x=14
if x=="F":
    x=15
if y=="A":
    y=10
if y=="B":
    y=11
if y=="C":
    y=12
if y=="D":
    y=13
if y=="E":
    y=14
if y=="F":
    y=15
if x<y:
    print("<")
elif x>y:
    print(">")
elif x==y:
    print("=")

Fixed submission:
x,y=input().split()
lis=["A","B","C","D","E","F"]
for i in range(6):
    if x==lis[i]:x=i+10
    if y==lis[i]:y=i+10
if x<y:print("<")
elif x>y:print(">")
elif x==y:print("=")

Buggy python submission (verdict: Runtime Error):
x,y=input().split()
if x=="A":x=10
if x=="B":X=11
if x=="C":x=12
if x=="D":x=13
if x=="E":x=14
if x=="F":x=15
if y=="A":y=10
if y=="B":y=11
if y=="C":y=12
if y=="D":y=13
if y=="E":y=14
if y=="F":y=15
if x<y:print("<")
elif x>y:print(">")
else:print("=")

Fixed submission:
x,y=input().split()
lis=["A","B","C","D","E","F"]
for i in range(6):
    if x==lis[i]:x=i+10
    if y==lis[i]:y=i+10
if x<y:print("<")
elif x>y:print(">")
elif x==y:print("=")
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a==b==c:
    print(1)
elif a==b or b==c or a==b:
    print(2)
else:
    print(3)3 3 33

Fixed submission:
a=input().split()
b=set(a)
print(len(b))
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=int(input())
B=int(input())

train=A*N
taxi=B
if (train<=taxi):
  print(train)
else:
  print(taxi)

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

train=a[0]*a[1]
taxi=a[2]
if (train<=taxi):
  print(train)
else:
  print(taxi)

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

int train=A*N
int taxi=B
if (train<=taxi):
  print(train)
else:
  print(taxi)

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

train=a[0]*a[1]
taxi=a[2]
if (train<=taxi):
  print(train)
else:
  print(taxi)

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

int train=A*N
int taxi=B
if (train<=taxi):
  print(train)
else:
  print(taxi)

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

train=a[0]*a[1]
taxi=a[2]
if (train<=taxi):
  print(train)
else:
  print(taxi)
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())

if (a>=b)&&(b>=c):
  ans=a+b
  print("",ans)
elif (b>=a)&&(c>=a):
  ans=b+c
  print("",ans)
else (a>=c)&&(c>=b):
  ans=a+c
  print("",ans)

Fixed submission:
num=list(map(int, input().split()))
num=sorted(num)
ans=num[0]+num[1]

print(ans)
Buggy python submission (verdict: Runtime Error):
 = input()
if (N[0] == N[1] and N[1] == N[2]) or (N[1] == N[2] and N[2] == N[3]):
    print("Yes")
else:
    print("No")

Fixed submission:
N = input()
if (N[0] == N[1] and N[1] == N[2]) or (N[1] == N[2] and N[2] == N[3]):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
d = a + b + c

if a = b:
    print(c)
elif b = c:
    print(a)
elif c = a:
    print(b)

Fixed submission:
a, b, c = map(int, input().split())
d = a + b + c

if a == b:
    print(c)
elif b == c:
    print(a)
elif c == a:
    print(b)
Buggy python submission (verdict: Runtime Error):
a, b = map  (int, input().split())
c = a + b

if c < 10:
    print(c)
else:
    print(error)

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

if c < 10:
    print(c)
else:
    print("error")
Buggy python submission (verdict: Runtime Error):
S=int(input())
a=S
b=[]
while a>0:
    b.append(a%10)
    a//=10
if b[0]==b[1] or b[1]==b[2] or b[2]==b[3]:
    print("Bad")
else:
    print("Good")

Fixed submission:
S=int(input())
a=S
b=[]
for i in range(4):
    b.append(a%10)
    a//=10
if b[0]==b[1] or b[1]==b[2] or b[2]==b[3]:
    print("Bad")
else:
    print("Good")
Buggy python submission (verdict: Runtime Error):
N=int(input())
W=[]
for i in range(N):
    w=input()
    W.append(w)
    last=W[0][-1]
    S=set()
    S.add(w[0])
for i in range(1,N):
    if W[i][0]==last and not W[i] in S:
        pass
    else:
        print("No")
        exit()
    S.add(w[i])
    last=w[i][-1] #ケツ追加した
print("Yes")

Fixed submission:
N=int(input())
W=[]
for i in range(N):
    w=input()
    W.append(w)
last=W[0][-1]
S=set()
S.add(W[0])
for i in range(1,N):
    if W[i][0]==last and not W[i] in S:
        pass
    else:
        print("No")
        exit()
    S.add(W[i])
    last=W[i][-1]
print("Yes")
Buggy python submission (verdict: Runtime Error):
a = input()
b = 0
for i in a:
     b += int(i)
if int(a)%b == 0:
     print("Yes")
else:
     print("No")

Fixed submission:
s = input()
k = 0
for i in s:
    if i == "+":
        k += 1
    else:
        k -= 1
print(k)
Buggy python submission (verdict: Runtime Error):
L,R = map(int,input().split())
ans = 1000000000
for i in range(L,R + 1):
	if ans == 0:
		break
		
	for j in range(i,R + 1):
		if ans > i*j % 2019:
			ans = i*j % 2019
			if ans == 0
				break
print(ans)

Fixed submission:
L,R = map(int,input().split())
ans = 10000000000
for i in range(L,R + 1):
	if ans == 0:
		break
		
	for j in range(i + 1,R + 1):
		if ans > i*j % 2019:
			ans = i*j % 2019
			if ans == 0:
				break
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b = input().split()
print(a - b + 1)

Fixed submission:
a = list(map(int,input().split()))
print(a[0] - a[1] + 1)
Buggy python submission (verdict: Runtime Error):
import math

n = int(input())
m = list(map(int,input().split()))
ans = 0

for i in range(n):
	ans = math.gcd(ans,m[i])
print(ans)

Fixed submission:
import fractions

n = int(input())
m = list(map(int,input().split()))
ans = 0

for i in range(n):
	ans = fractions.gcd(ans,m[i])
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b = map(str, input().split())
count = 0
num = a
sub = 0
for i in range(a,b + 1):
	if num[0] == num[4] and num[1] == num[3]:
		count = count + 1
	sub = int(num) + 1
	num = str(sub)
	
print(count)

Fixed submission:
a,b = map(str, input().split())
count = 0
num = a
sub = 0
line = int(b) - int(a) + 1

for i in range(line):
	if num[0] == num[4] and num[1] == num[3]:
		count = count + 1
	sub = int(num) + 1
	num = str(sub)
	
print(count)
Buggy python submission (verdict: Runtime Error):
N=input()
if N[0]==N[1] and N[1]==N[2]:
	print("Yes")
elif N[2]==N[3] and N[3]==N[4]:
	print("Yes")
else:
	print("No")

Fixed submission:
N=input()
if N[0]==N[1] and N[1]==N[2]:
	print("Yes")
elif N[1]==N[2] and N[2]==N[3]:
	print("Yes")
else:
	print("No")
Buggy python submission (verdict: Runtime Error):
a = int(input())
c = 1

while (c <= a):
c = c * 2

print(int(c/2))

Fixed submission:
a = int(input())
c = 1

while (c <= a):
	c = c * 2

print(int(c/2))
Buggy python submission (verdict: Runtime Error):
S = list(input())
r = S[0]
for i in range(4):
 S.remove(r)
if S[0] == S[1] and len(S) == 2:
 print('Yes')
else:
 print('NO')

Fixed submission:
S = set(input())
print('Yes' if len(S) == 2 else 'No')

Buggy python submission (verdict: Runtime Error):
S = list(input())
r = S[0]
for i in range(4)
 S.remove(r)
if S[0] == S[1] and len(S) == 2:
 print('Yes')
else:
 print('NO')

Fixed submission:
S = set(input())
print('Yes' if len(S) == 2 else 'No')

Buggy python submission (verdict: Runtime Error):
S = list(input())
r = S[0]
S.remove(r)
S.remove(r)
if S[0] == S[1] and len(S) == 2:
 print('Yes')
else:
 print('NO')

Fixed submission:
S = set(input())
print('Yes' if len(S) == 2 else 'No')
Buggy python submission (verdict: Runtime Error):
n,k = map(int, input().split())
s = input()

b = ""
for i in range(n):
  if i == k-1:
    b += s[i].lower
  else:
    b += s[i]
    
print(b)

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

b = ""
for i in range(n):
  if i == k-1:
    b += s[i].lower()
  else:
    b += s[i]
    
print(b)

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

b = ""
for i in range(n):
  if i == k-1:
    b += s[i].lower
  else:
    b += s[i]
    
print(b)

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

b = ""
for i in range(n):
  if i == k-1:
    b += s[i].lower()
  else:
    b += s[i]
    
print(b)
Buggy python submission (verdict: Runtime Error):
S = input()
A = int(S[0:2])
B = int(S[2:4])

if 0 < A and A <= 12:
  if 0 < B and B <= 12:
    print(AMBIGUOUS)
  else:
    print(MMYY)
else:
  if 0 < B and B <= 12:
    print(YYMM)
  else:
    print(NA)

Fixed submission:
S = input()
A = int(S[0:2])
B = int(S[2:4])

if 0 < A and A <= 12:
  if 0 < B and B <= 12:
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
  if 0 < B and B <= 12:
    print("YYMM")
  else:
    print("NA")
Buggy python submission (verdict: Runtime Error):
import functools
import fractions

N = int(input())
A = [int(i) for i in input().split()]

num = 1

if len(A) == 2:
  print(max(A))
else:
  for i in range(len(A)):
    g = functools.reduce(fractions.gcd, A[:i] + A[i+1:])
    num = g if g > num else num
  print(num)


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

n = t // a
print(n * b)

Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
A = [int(i) for i in input().split()]

num = 1

if len(A) == 2:
  print(max(A))
else:
  for i in range(len(A)):
    B = A[ : i] + A[i + 1:]
    g = reduce(math.gcd, B)
    if (g > num):
      num = g
  print num


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

n = t // a
print(n * b)

Buggy python submission (verdict: Runtime Error):
import math
N = int(raw_input())
A = [int(i) for i in raw_input().split()]

num = 1

if len(A) == 2:
  print(max(A))
else:
  for i in range(len(A)):
    B = A[ : i] + A[i + 1:]
    g = reduce(math.gcd, B)
    if (g > num):
      num = g
  print num


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

n = t // a
print(n * b)

Buggy python submission (verdict: Runtime Error):
import functools
import math
N = int(input())
A = [int(i) for i in input().split()]
num = 1
for i in range(len(A)):
  B = A[:i] + A[i+1:]
  g = functools.reduce(math.gcd, B)
  if g > num:
    num = g    
print(num)


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

n = t // a
print(n * b)
Buggy python submission (verdict: Runtime Error):
import numpy as np

N = int(input())
A = [int(i) for i in input().split()]

ab = len([n for n in A if n <0]) % 2

B = np.sort(np.abs(A))
if ab == 0:
  print(sum(A))
else:
  print(sum(A[1 :] - A[0]))

Fixed submission:
import numpy as np

N = int(input())
A = [int(i) for i in input().split()]

ab = len([n for n in A if n <0]) % 2

B = np.sort(np.abs(A))
if ab == 0:
  print(sum(B))
else:
  print(sum(B[1 :]) - B[0])
Buggy python submission (verdict: Runtime Error):
import numpy as np
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

A = a % 10
B = b % 10
C = c % 10
D = d % 10
E = e % 10

S = []
sum = 0
if A != 0:
  S.append(A)
if B != 0:
  S.append(B)
if C != 0:
  S.append(C)
if D != 0:
  S.append(D)
if E != 0:
  S.append(E)
if len(S) == 0:
  sum = a + b + c + d + e
else:
  sum = (a //10 + b //10 + c //10 + d //10 + e //10)*10 + 10*(len(A) - 1) +min(S)
print(sum)


Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if abs(a - b) <= k and abs(a - c) <= k and abs(a - d) <= k and abs(a - e) <= k and abs(b - c) <= k and abs(b - d) <= k and abs(b - e) <= k and abs(c - d) <= k and abs(c - e) <= k and abs(d - e) <= k:
  print("Yay!")
else:
  print(":(")
Buggy python submission (verdict: Runtime Error):
import numpy as np
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

A = list(str(a))
B = list(str(b))
C = list(str(c))
D = list(str(d))
E = list(str(e))

S = []
sum = 0
if A[-1] == "0":
  sum += a
else:
  S.append(A[-1])
  sum += a + (10 - int(A[-1]))

if B[-1] == "0":
  sum += b
else:
  S.append(B[-1])
  sum += b + (10 - int(B[-1]))

if C[-1] == "0":
  sum += c
else:
  S.append(C[-1])
  sum += c + (10 - int(C[-1]))

if D[-1] == "0":
  sum += d
else:
  S.append(D[-1])
  sum += d + (10 - int(D[-1]))

if E[-1] == "0":
  sum += e
else:
  S.append(E[-1])
  sum += e + (10 - int(E[-1]))

if len(S) != "0":
  k = np.argmin(S)
  sum += int(S[k]) - 10
print(sum)

Fixed submission:
import numpy as np
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

A = a % 10
B = b % 10
C = c % 10
D = d % 10
E = e % 10

S = []
sum = 0
if A != 0:
  S.append(A)
if B != 0:
  S.append(B)
if C != 0:
  S.append(C)
if D != 0:
  S.append(D)
if E != 0:
  S.append(E)
if len(S) == 0:
  sum = a + b + c + d + e
else:
  sum = (a //10 + b //10 + c //10 + d //10 + e //10)*10 + 10*(len(S) - 1) +min(S)
print(sum)

Buggy python submission (verdict: Runtime Error):
import numpy as np
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

A = list(str(a))
B = list(str(b))
C = list(str(c))
D = list(str(d))
E = list(str(e))

k = np.argmin([A[-1], B[-1], C[-1], D[-1], E[-1]])
sum = 0
if A[-1] == 0:
  sum += a
else:
  sum += a + (10 - int(A[-1]))
if B[-1] == 0:
  sum += b
else:
  sum += b + (10 - int(B[-1]))
if C[-1] == 0:
  sum += c
else:
  sum += c + (10 - int(C[-1]))
if D[-1] == 0:
  sum += d
else:
  sum += d + (10 - int(D[-1]))
if E[-1] == 0:
  sum += e
else:
  sum += e + (10 - int(E[-1]))
sum -= 10 - [A[-1], B[-1], C[-1], D[-1], E[-1]][k]
print(sum)

Fixed submission:
import numpy as np
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

A = a % 10
B = b % 10
C = c % 10
D = d % 10
E = e % 10

S = []
sum = 0
if A != 0:
  S.append(A)
if B != 0:
  S.append(B)
if C != 0:
  S.append(C)
if D != 0:
  S.append(D)
if E != 0:
  S.append(E)
if len(S) == 0:
  sum = a + b + c + d + e
else:
  sum = (a //10 + b //10 + c //10 + d //10 + e //10)*10 + 10*(len(S) - 1) +min(S)
print(sum)
Buggy python submission (verdict: Runtime Error):
s = list(input())
t = 700 + s.count(o) * 100
print(t)

Fixed submission:
s = list(input())
t = 700 + s.count("o") * 100
print(t)

Buggy python submission (verdict: Runtime Error):
s = input()
print("{}".format(700 + s.count(o)))

Fixed submission:
s = list(input())
t = 700 + s.count("o") * 100
print(t)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = int(input())

N = N % 500
if N =< A:
  print("Yes")
else:
  print("No")

Fixed submission:
N = int(input())
A = int(input())

B = N % 500
if B <= A:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
print('ACL' * input())

Fixed submission:
print('ACL' * int(input()))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
a = [A for A in a if a != 0]
from itertools import combinations

MOD = 10**9 + 7
ans = 0
for i,j in combinations(a, 2):
    ans = ans + (i*j)%MOD

print(ans%MOD)

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

from itertools import accumulate
cumsum = list(accumulate(a[::-1]))[::-1]

MOD = 10**9+7
ans = 0
for i,A in enumerate(a[:-1]):
    ans += A * cumsum[i+1]
    ans = ans % MOD
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = list(map(int, input().split()))
a = list(map(int, input().split()))

points = []

p = 1
for i in range(k):
    p *= a[i]

points.append(p)
for i in range(n-k):
    p = p * a[i+k] // a[i]
    points.append(p)

for p,n in zip(points, points[1:]):
    if p < n:
        print('Yes')
    else:
        print('No')

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

for p,n in zip(a, a[k:]):
    if p < n:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n,m,k = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))

from itertools import accumulate
import bisect
cumsum_a = list(accumulate(a))
cumsum_b = list(accumulate(b))

ans = 0
for i in range(n+1):
    cnt_a = bisect.bisect(cumsum_a[:i], k)
    time = k - cumsum_a[cnt_a - 1]
    cnt_b = bisect.bisect(cumsum_b, time)
    
    ans = max(ans, cnt_a + cnt_b)

for i in range(m+1):
    cnt_b = bisect.bisect(cumsum_b[:i], k)
    time = k - cumsum_b[cnt_b - 1]
    cnt_a = bisect.bisect(cumsum_a, time)
    
    ans = max(ans, cnt_a + cnt_b)

print(ans)

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

from itertools import accumulate
import bisect

A = [0] + list(accumulate(a))
B = list(accumulate(b))

ans = 0
for ac in range(n+1):
    if A[ac] > k:
        break
    bc = bisect.bisect_right(B, k-A[ac])
    ans = max(ans, ac+bc)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 0
for i in range(1, n+1):
    A1 = i
    c =  n//i
    An = A1 + i * (c - 1)
    ans += (A1 + An) * c // 2

print(ans)

Fixed submission:
n = int(input())
ans = 0
for i in range(1, n+1):
    A1 = i
    c =  n//i
    An = A1 + i * (c - 1)
    ans += (A1 + An) * c // 2

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
q = int(input())
bc = [list(map(int, input().split())) for _ in range(q)]

from collections import Counter
counter = Counter(a)

for b,c in bc:
    if b in counter:
        cnt = counter.pop(b)
        counter[c] += cnt
    print(sum([k*v for k,v in counter.items()]))

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

q = int(input())

from collections import Counter

ca = Counter(a)

ans=sum(a)
for _ in range(q):
    b,c = list(map(int, input().split()))
    
    if b in ca:
        cnt = ca.pop(b)
        ca[c] += cnt

        ans -= b * cnt
        ans += c * cnt
    
    print(ans)

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

q = int(input())

from collections import Counter

ca = Counter(a)

def sum_dict(dic):
    return sum([num*cnt for num,cnt in dic.items()])

for _ in range(q):
    b,c = list(map(int, input().split()))
    
    if b in ca:
        cnt = ca.pop(b)
        ca[c] += cnt
    
    print(sum_dict(ca))

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

q = int(input())

from collections import Counter

ca = Counter(a)

ans=sum(a)
for _ in range(q):
    b,c = list(map(int, input().split()))
    
    if b in ca:
        cnt = ca.pop(b)
        ca[c] += cnt

        ans -= b * cnt
        ans += c * cnt
    
    print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

from collections import Counter
ca = Counter(a)

# 同じ数はまとめる
remain = []
ans=0
for i,cnt in ca.items():
    if cnt >1:
        ans+=cnt
    else:
        remain.append(i)

remain.sort(reverse=True)
print(ans)
for i in range(len(remain)):
    for j in range(i+1,n):
        if remain[i]%remain[j]==0:
            ans+=1
            break
print(n-ans)

Fixed submission:
n = int(input())
a = sorted(list(map(int, input().split())))
MA = (max(a) + 1)
ans = [0] * MA

for i in range(n):
    for j in range(a[i],MA,a[i]):
        ans[j] += 1
print(sum(ans[i]==1 for i in a))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans=0
for i in range(n):
    for j in range(n):
        if i==j:
            continue
        if a[i]%a[j]==0:
            ans+=1
            break
print(n-ans)

Fixed submission:
n = int(input())
a = sorted(list(map(int, input().split())))
MA = (max(a) + 1)
ans = [0] * MA

for i in range(n):
    for j in range(a[i],MA,a[i]):
        ans[j] += 1
print(sum(ans[i]==1 for i in a))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
from itertools import accumulate
import operator
cumprod = list(accumulate(a, operator.mul))[-1]

print(-1 if cumprod > 10**18 else cumprod)

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

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

cumprod=1
for i in range(n):
    cumprod *= a[i]
    if cumprod > 10**18:
        print(-1)
        exit()
print(cumprod)
Buggy python submission (verdict: Runtime Error):
a,b,h,m = list(map(int, input().split()))

hh=360*(60*h+m)/(60*12)
mm=360*(m/60)
rad=hh-mm
if rad > 180:
    rad=360-rad
print(math.sqrt(a**2+b**2-2*a*b*math.cos(math.radians(rad))))


Fixed submission:
import math
a,b,h,m = list(map(int, input().split()))

hh=360*(60*h+m)/(60*12)
mm=360*(m/60)
rad=hh-mm
if rad > 180:
    rad=360-rad
print(math.sqrt(a**2+b**2-2*a*b*math.cos(math.radians(rad))))

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

hh=360*(60*h+m)/(60*12)
mm=360*(m/60)
rad=hh-mm
if rad > 180:
    rad=360-rad
print(rad)
print(math.sqrt(a**2+b**2-2*a*b*math.cos(math.radians(rad))))

Fixed submission:
import math
a,b,h,m = list(map(int, input().split()))

hh=360*(60*h+m)/(60*12)
mm=360*(m/60)
rad=hh-mm
if rad > 180:
    rad=360-rad
print(math.sqrt(a**2+b**2-2*a*b*math.cos(math.radians(rad))))
Buggy python submission (verdict: Runtime Error):
a,b,n = list(map(int, input().split()))
def f(x):
    return a*x//b - a*(x//b)

left=1
right=n
for _ in range(100):
    delta=(right-left)/3
    midl=left+delta
    midr=midl+delta
#    print(f'left={left} midl={midl} midr={midr} right={right}')
    if f(midl)>f(midr):
        right=midr
    else:
        left=midl
print(max(f(int(midl)),f(min(int(midl)+1),n)))

Fixed submission:
a,b,n = list(map(int, input().split()))
def f(x):
    return a*x//b - a*(x//b)

left=1
right=n
for _ in range(100):
    delta=(right-left)/3
    midl=left+delta
    midr=midl+delta
#    print(f'left={left} midl={midl} midr={midr} right={right}')
    if f(midl)>f(midr):
        right=midr
    else:
        left=midl
print(max(f(int(midl)),f(min(int(midl)+1,n))))
Buggy python submission (verdict: Time Limit Exceeded):
from math import gcd
k = int(input())+1
ans = 0
for i in range(1,k):
  for j in range(1,k):
    for l in range(1,k):
      if 1 in [i,j,k]:
          ans+=1
      else:
          ans += gcd(gcd(i,j),l)
print(ans)


Fixed submission:
from math import gcd
k = int(input())+1
ans = 0
for i in range(1,k):
  for j in range(1,k):
    for l in range(1,k):
      ans += gcd(gcd(i,j),l)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
mem={}
def gcd(a,b,c):
    key=tuple(sorted((a,b,c)))
    if key in mem:
        return mem[key]
    ret=1
    for i in range(2, min(a,b,c)+1):
        if a%i==0 and b%i==0 and c%i==0:
            ret=i
    mem[key]=ret
    return ret
        
ans=0
for i in range(1, n+1):
    for j in range(1, n+1):
        for k in range(1, n+1):
            ans+=gcd(i, j, k)
print(ans)

Fixed submission:
from math import gcd
k = int(input())+1
ans = 0
for i in range(1,k):
  for j in range(1,k):
    for l in range(1,k):
      ans += gcd(gcd(i,j),l)
print(ans)