Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
hu

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
MOD=10**9+7
def findProductSum(A, n): 
    array_sum = 0
    for i in range(0, n, 1): 
        array_sum=array_sum+A[i]
    array_sum_square = array_sum * array_sum 
    individual_square_sum = 0
    for i in range(n): 
        individual_square_sum += A[i] * A[i]
    return (array_sum_square - individual_square_sum)//2

print(findProductSum(a,n)%MOD)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())

a=0
for i in range(len(str(n))):
    a+=int(str(n)[i])


if a%9==0:
    print("Yes")

else:
    print("No")

Fixed submission:
n=int(input())


if n%9==0:
    print("Yes")

else:
    print("No")

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
m=n
a=0
for i in range(len(str(n))):
    a+=m%10

    m=m//10

if a%9==0:
    print("Yes")

else:
    print("No")

Fixed submission:
n=int(input())


if n%9==0:
    print("Yes")

else:
    print("No")
Buggy python submission (verdict: Runtime Error):
x,y=map(int,input().split())
z=0
 
for i in range(x):
    if i*2+(x-i)*4!==y:
        z=z
    else:
        z=1
 
if z==1:
    print("Yes")
else:
    print("No")

Fixed submission:
x,y=map(int,input().split())
z=0
 
for i in range(0,x+1):
    if i*2+(x-i)*4 == y:
        z=1

 
if z==1:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().supkit())
print(a*b)

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

if S<=W:
    print("unsafe")
else:
    print("safe")

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

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

if S<=W:
    print("unsafe")
else:
    print("safe")

Fixed submission:
S, W = map(int, input().split())
 
print("unsafe" if W >= S else "safe")
Buggy python submission (verdict: Runtime Error):
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))

k=0
m=100000000000000
for i in range(1,n+1):
    b=a-t+h[i]*0.006
    if m>abs(b):
        m=abs(b)
        k=i


print(k)        
        

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

k=0
m=100000000000000
for i in range(1,n+1):
    b=a-t+h[i-1]*0.006
    if m>abs(b):
        m=abs(b)
        k=i


print(k)
Buggy python submission (verdict: Runtime Error):
n=int(input())


a=0
for i in　range(0,26):
    for j in range(0,20):
        if 4*i+7*j==n:
            a+=1


if a==0:
    print("N0")
else:
    print("Yes")


Fixed submission:
n=int(input())


a=0
for i in range(0,n):
    for j in range(0,n):
        if 4*i+7*j==n:
            a+=1


if a==0:
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
n=int(input())

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

max=0
for i in range(n):
    for j in range(n):
        if i!=j:
            abs=abs(a[i]-a[j])
            if max<=abs:
                max=abs


print(max)
    


Fixed submission:
n=int(input())

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

max=0
for i in range(n):
    for j in range(n):
        if i!=j:
            x=int(a[i]-a[j])
            if x<0:
                x *=-1
                if max<=x:
                    max=x


print(max)
Buggy python submission (verdict: Runtime Error):
S = input()
s = S.count(”o”)*100
 
print(700+s)

Fixed submission:
S = input()
s = S.count('o')*100
 
print(700+s)

Buggy python submission (verdict: Runtime Error):
s=str(input())
y=700
x=0
while x!=2
if s[x]=Ｏ：
　　　y+=100
else:
    y+=0  
x+=1
break
print(y)

Fixed submission:
S = input()
s = S.count('o')*100
 
print(700+s)

Buggy python submission (verdict: Runtime Error):
s=str(input())
y=700
x=0
while x!=2
if s[x]=o：
　　　y+=100
else:
    y+=0  
x+=1

print(y)

Fixed submission:
S = input()
s = S.count('o')*100
 
print(700+s)

Buggy python submission (verdict: Runtime Error):
s=str(input())
y=700
x=0
while x!=2
if s[x]=o：
　　　y+=100
else:
    y+=0  
x+=1
break
print(y)

Fixed submission:
S = input()
s = S.count('o')*100
 
print(700+s)

Buggy python submission (verdict: Runtime Error):
s=str(input())
y=700
x=0
while x!=2
if s[x]=o：
　　　y+=100
 
x+=1

print(y)

Fixed submission:
S = input()
s = S.count('o')*100
 
print(700+s)

Buggy python submission (verdict: Runtime Error):
s=str(input())
y=700
x=0
while x!=2
if s[x]=o：
　　　y+100
x+=1

print(y)

Fixed submission:
S = input()
s = S.count('o')*100
 
print(700+s)

Buggy python submission (verdict: Runtime Error):
s=str(input())
y=700
x=0
while x!=2
if s[x]=o：
　　　y+=100
x+=1
break
print(y)

Fixed submission:
S = input()
s = S.count('o')*100
 
print(700+s)

Buggy python submission (verdict: Runtime Error):
s=str(input())
y=700
x=0
while x!=2
if s[x]=o：
　　　y+100
x+=1
break
print(y)

Fixed submission:
S = input()
s = S.count('o')*100
 
print(700+s)

Buggy python submission (verdict: Runtime Error):
s=str(input())
y=700
x=0
while x!=2
if s[x]=o：
　　　y+100
x+=1
print(y)

Fixed submission:
S = input()
s = S.count('o')*100
 
print(700+s)
Buggy python submission (verdict: Runtime Error):
n,a=map(int,input().split())
if n%500>a:
    print("NO")
else:
    print("YES")

Fixed submission:
n=int(input())
a=int(input())

if n%500>a:
    print("No")
else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
n,a=map(int,input().split())
if n//500>a:
    print("NO")
else:
    print("YES")

Fixed submission:
n=int(input())
a=int(input())

if n%500>a:
    print("No")
else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
n,a=map(int,input().split())
if n//500>a:
  print("NO")
else:
  print("YES")

Fixed submission:
n=int(input())
a=int(input())

if n%500>a:
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=0
m=n
while n>0:
    n=n//10
    a=a+n%10

if m%a==0:
    print("Yes")
else:
    print("No")
    

Fixed submission:
n=int(input())
a=0
m=n
if n==0:
    print("No")

else:
    
    while n>0:
        
        a=a+n%10
        n=n//10
    if m%a==0:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
s=input()
print(s[0]+len(s[1:-1])+s[-1])

Fixed submission:
s=input()
print(s[0]+str(len(s[1:-1]))+s[-1])

Buggy python submission (verdict: Runtime Error):
s=input()
print(s[1]+(len(s)-2)+s[-1])

Fixed submission:
s=input()
print(s[0]+str(len(s[1:-1]))+s[-1])
Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = 0
out = 1
for i in range(1, n + 1):
    cnt = 0
    while i % 2 == 0:
        i //= 2
        cnt += 1
    if cnt > ans:
        ans = cnt
        out = i * 2 ** ant
print(out)

Fixed submission:
n = int(input())
count = 0
for i in range(8):
    if 2**i <= n:
        count = 2**i
print(count)
Buggy python submission (verdict: Runtime Error):
n,l=map(int,input().split())
s=[]
for i in range(n):
    s.append(str(input()))

a="".join(sorted(s))    

             
print(a

Fixed submission:
n,l=map(int,input().split())
s=[]
for i in range(n):
    s.append(str(input()))

a="".join(sorted(s))    

             
print(a)
Buggy python submission (verdict: Runtime Error):
n, k = input().split()
n, k = int(n), int(k)
balls = input().split()
dic = {}
for x in balls:
	if x not in dic:
		dic[x] = 1
	else:
		dic[x] += 1
change = 0
qnt = list(dic.values())
qnt.sort()
dif = len(qnt) - k
while dif:
	change += qnt[0]
	qnt.pop(0)
	dif -= 1
print(change)

Fixed submission:
n, k = input().split()
n, k = int(n), int(k)
balls = input().split()
dic = {}
for x in balls:
	if x not in dic:
		dic[x] = 1
	else:
		dic[x] += 1
change = 0
qnt = list(dic.values())
qnt.sort()
dif = len(qnt) - k
for x in range(0, dif):
	change += qnt[x]
print(change)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = input().split()
n, k = int(n), int(k)
balls = [int(x) for x in input().split()]
dic = {}
for x in balls:
	if x not in dic:
		dic[x] = 1
	else:
		dic[x] += 1
change = 0
qnt = list(dic.values())
qnt.sort()
while len(qnt) > k:
	change += qnt[0]
	qnt.pop(0)
print(change)

Fixed submission:
n, k = input().split()
n, k = int(n), int(k)
balls = input().split()
dic = {}
for x in balls:
	if x not in dic:
		dic[x] = 1
	else:
		dic[x] += 1
change = 0
qnt = list(dic.values())
qnt.sort()
dif = len(qnt) - k
for x in range(0, dif):
	change += qnt[x]
print(change)
Buggy python submission (verdict: Runtime Error):
n = int(input())
cnt =0
def dice():
    for i in range(n):
        d = list(map(int, input().split()))
        if d[0] == d[1]:
            cnt += 1
            if cnt == 3:
                return "Yes"
            
        else:
            cnt = 0

ans = dice()

print(ans)

Fixed submission:
n = int(input())

d = []
for i in range(n):
    d.append(list(map(int, input().split())))

def dice():
    cnt =0
    for i in range(n):
        if d[i][0] == d[i][1]:
            cnt += 1
            if cnt == 3:
                return "Yes"
                break
        else:
            cnt = 0
    return "No"

ans = dice()

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
cnt = 0

for i in range(1,n):
    for j in range(1, n):
        if i * j < n:
            cnt += 1

print(cnt)

Fixed submission:
n = int(input())
cnt = 0

for i in range(1,n):
    b = n//i
    c = n%i
    if c:
        cnt += b
    else:
        cnt += b-1
    

print(cnt)
Buggy python submission (verdict: Runtime Error):
x = int(input())
if x = 1:
  print("0")
else:
  print("1")

Fixed submission:
x = int(input())
if x == 1:
  print(0)
else:
  print(1)

Buggy python submission (verdict: Runtime Error):
x = int(input())
if x = 0:
  print(1)
else:
  print(0)

Fixed submission:
x = int(input())
if x == 1:
  print(0)
else:
  print(1)
Buggy python submission (verdict: Runtime Error):
N = int(input()) #入力する整数
A = list(map(int,input().split())) #入力する数列A
SUMA = sum(A) #数列の和
MOD = 10**9 + 7 # mod
C = [0] * (N-1) #累積和数列
for i in range(N-1): #\sum_{j = i+1}^{N}を求めて数列に代入する
  SUMA -= A[i]
  C[i] = SUMA
ans = 0 #求める答え
for i in range(N-1):
  ans += A[i]*C[i]
  ans %= MOD #その都度modで割った余りにする
print(ans) #答えを出力する

Fixed submission:
d, t, s = map(int, input().split())
if d/s <= t:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
ans = []
for i in range(len(s)-len(t)):
    cnt = 0
    for j in range(len(t)):
        if t[j] != s[i+j]:
            cnt += 1
    ans.append(cnt)
    
cnt2 = min(ans)
print(cnt2)
    

Fixed submission:
s = input()
t = input()
ans = []
for i in range(len(s)-len(t)+1):
    cnt = 0
    for j in range(len(t)):
        if t[j] != s[i+j]:
            cnt += 1
    ans.append(cnt)
    
cnt2 = min(ans)
print(cnt2)
Buggy python submission (verdict: Runtime Error):
def walking():
    x, k, d = map(int, input().split())
    r = 0
    if x > 0 and x > k * d:
        return x - k * d
    elif x < 0 and x < -k * d:
        return x + k * d
    elif x > 0 and x < k * d:
        r = x//d
        if (k - r)%2 == 0:
            return x - r * d
        else:
            return x - (r + 1 ) * d
    elif x < 0 and x < -k * d:
        r = x//d
        if (k + r)%2 == 0:
            return x - r * d
        else:
            return x - (r + 1 ) * d        
    
loc = walking()
print(abs(loc))

Fixed submission:
k = input()

if k == "RRR":
    print(3)
elif k == "RRS":
    print(2)
elif k == "SRR":
    print(2)
elif k == "RSS":
    print(1)
elif k == "RSR":
    print(1)
elif k == "SSR":
    print(1)
elif k == "SRS":
    print(1)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
S = list(input())
T = list(input())

length = int(len(S))
difference = 0

for i in range(length):
    if S[i] != T[i]:
        difference = difference + 1

if difference%2 == 0:
    change = difference/2
if difference%2 != 0:
    change = (difference+1)/2
    
print(str(change))

Fixed submission:
a = int(input())
print(str(a+a*a+a*a*a))
Buggy python submission (verdict: Runtime Error):
S = list(input())
T = list(input())

length = int(len(S))
difference = 0

for i in range(length):
    if S[i] != T[i]:
        difference = difference + 1

if difference%2 == 0:
    change = difference/2
if differenc%2 != 0:
    change = (difference+1)/2
    
print(str(change))

Fixed submission:
S = list(input())
T = list(input())

length = int(len(S))
difference = 0

for i in range(length):
    if S[i] != T[i]:
        difference = difference + 1

   
print(str(difference))
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
price = list(map(int, input().split()))
total = price.sorted[:K]
print(total)
    

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

p.sort()
ans=0

for i in range(k):
    ans += p[i]
    
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 *= a[i]
    
if ans <= 10**18:
    print(ans)
else:
    print(-1)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = 1
if 0 in a:
    ans = 0
else:
    for i in range(n):
        ans *= a[i]
        if ans > 10**18:
            break
if ans <= 10**18:
    print(ans)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
c = n[-1]

if c in ["24579"]:
    print("hon")
elif c in ["0168"]:
    print("pon")
else:
    print("bon")

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

for i in range(n-1):
    k[a[i-1]] += 1

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

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

for i in range(n-1):
    k[a[i]-1] += 1

for i in range(len(k)):
    print(k[i])
Buggy python submission (verdict: Runtime Error):
n, k, m = map(int, input().split())
A = list(map(int, input().split()))
test_sum = 0

for i in range(n-1):
    test_sum = test_sum + A[i]
    
test_n = (m * n) - test_sum
if test_n >= k:
    print("-1")
else:
    print(str(test_n))

Fixed submission:
c = ord(input())
next = c + 1
print(chr(next))
Buggy python submission (verdict: Runtime Error):
import sys
 
a,b,h=map(int,input().split())

square = (a + b) * h / 2

print(int(square))

Fixed submission:
import sys

a,b,h=[int(input()) for i in range(3)]

square = (a + b) * h / 2

print(int(square))

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

square = (a + b) * h / 2

print(square)

Fixed submission:
import sys

a,b,h=[int(input()) for i in range(3)]

square = (a + b) * h / 2

print(int(square))
Buggy python submission (verdict: Runtime Error):
import sys

a = int(input())
b = int(input())
c = int(input())

if (a == 5 or a == 7):
  if (b == 5 or b == 7):
    if (c == 5 or c == 7):
      d = a * b * c
      if (d == 175):
        print("YES")
      else: print("NO")
    else: print("NO")
  else: print("NO")
else:
  print("NO")

Fixed submission:
import sys

a, b, c = map(int,input().split())

if (a == 5 or a == 7):
  if (b == 5 or b == 7):
    if (c == 5 or c == 7):
      d = a * b * c
      if (d == 175):
        print("YES")
      else: print("NO")
    else: print("NO")
  else: print("NO")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<utility>
#include<iomanip>
#include<map>
#include<queue>
#include<cmath>
#include<cstdio>

#define rep(i,n) for(int i=0; i<(n); ++i)
#define pai 3.1415926535897932384

using namespace std;
using ll =long long;
using P = pair<int,int>;

#define MAX_N 200001
#define MAX_M 200001

int N, M;
int K = 0;
int res = 0;

int A[MAX_N];
int B[MAX_M];


int main(int argc, const char * argv[]) {

    cin >> N >> M >> K;
    
    rep(i, N){
        int a;
        cin >> a;
        if(i==0) A[i] = a;
        else A[i] = A[i-1] + a;
    }
    
    rep(i, M){
        int b;
        cin >> b;
        if(i==0) B[i] = b;
        else B[i] = B[i-1] + b;
    }
    
    int a=0;
    for(int i=0; i<N; i++){
        if(A[i]>K) continue;
        
        a=i+1;
    }
    int b=M;
    for(int j=M-1; j>=0; j--){
        if(B[j] <= K-A[a]){
            res = max(res, a+b);
            break;
        }
        b--;
    }
    
    cout << res << endl;
    
    return 0;
}


Fixed submission:
n,m,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
# Aの累積和
a_sum = [0]
for i in range(n):
    a_sum.append(a_sum[i] + a[i])
# Bの累積和
b_sum = [0]
for i in range(m):
    b_sum.append(b_sum[i] + b[i])
b_sum.append(10**20)
ans = 0
# Aを固定する
for i in range(n+1):
    t = a_sum[i]
    l = 0
    r = len(b_sum)
    # Bのうち何冊目まで読めるか二分探索する
    while l+1<r:
        # c:探索範囲の中央
        c = (l + r) // 2
        # 中央がK以下の場合は、求めたい位置が右にあるので
        # 探索範囲の左端を中央にする
        if t+b_sum[c]<=k:
            l = c
        # 中央がKよりも大きい場合は、求めたい位置が左にあるので
        # 探索範囲の右端を中央にする
        else:
            r = c
    # 合計がKを超えないか確認する
    if a_sum[i]+b_sum[l]<=k:
        ans = max(ans,i+l)
print(ans)

Buggy python submission (verdict: Runtime Error):
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

a, b = [0], [0]
for i in range(N):
    a.append(a[i] + A[i])
for i in range(M):
    b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
    if a[i] > K:
        break
while b[j] > K - a[i]:
    j -= 1
    ans = max(ans, i + j)
print(ans)

Fixed submission:
n,m,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
# Aの累積和
a_sum = [0]
for i in range(n):
    a_sum.append(a_sum[i] + a[i])
# Bの累積和
b_sum = [0]
for i in range(m):
    b_sum.append(b_sum[i] + b[i])
b_sum.append(10**20)
ans = 0
# Aを固定する
for i in range(n+1):
    t = a_sum[i]
    l = 0
    r = len(b_sum)
    # Bのうち何冊目まで読めるか二分探索する
    while l+1<r:
        # c:探索範囲の中央
        c = (l + r) // 2
        # 中央がK以下の場合は、求めたい位置が右にあるので
        # 探索範囲の左端を中央にする
        if t+b_sum[c]<=k:
            l = c
        # 中央がKよりも大きい場合は、求めたい位置が左にあるので
        # 探索範囲の右端を中央にする
        else:
            r = c
    # 合計がKを超えないか確認する
    if a_sum[i]+b_sum[l]<=k:
        ans = max(ans,i+l)
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
Q = int(input())

SUM=0
num=[0]*100000
for i in range(N):
    a=A[i]
    num[a]+=1
    SUM+=a

B=[0] * Q
C=[0] * Q
for i in range(Q):
    B[i],C[i]  = list(map(int, input().split()))

for i in range(Q):
    b = B[i]
    c = C[i]

    SUM = SUM - b * num[b]
    SUM = SUM + c * num[b]
    num[c] += num[b]
    num[b] = 0
    print(SUM)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
Q = int(input())

SUM=0
numbers=[0]*100001
for i in range(N):
    a=A[i]
    numbers[a]+=1
    SUM+=a

B=[0] * Q
C=[0] * Q
for i in range(Q):
    B[i],C[i]  = list(map(int, input().split()))

for i in range(Q):
    b = B[i]
    c = C[i]

    SUM = SUM - b * numbers[b]
    SUM = SUM + c * numbers[b]
    numbers[c] += numbers[b]
    numbers[b] = 0
    print(SUM)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
Q = int(input())

SUM=0
num=[0]*100000
for i in range(N):
    a=A[i]
    num[a]+=1
    SUM+=a

B=[0] * Q
C=[0] * Q
for i in range(Q):
    B[i],C[i]  = list(map(int, input().split()))

for i in range(Q):
    b = B[i]
    c = C[i]

    SUM = SUM - b * num[b]
    SUM = SUM + c * num[c]
    num[c] += num[b]
    num[b] = 0
    print(SUM)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
Q = int(input())

SUM=0
numbers=[0]*100001
for i in range(N):
    a=A[i]
    numbers[a]+=1
    SUM+=a

B=[0] * Q
C=[0] * Q
for i in range(Q):
    B[i],C[i]  = list(map(int, input().split()))

for i in range(Q):
    b = B[i]
    c = C[i]

    SUM = SUM - b * numbers[b]
    SUM = SUM + c * numbers[b]
    numbers[c] += numbers[b]
    numbers[b] = 0
    print(SUM)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A=list(map(int, input().split()))

ans=1
c=0

while c<N:
    if A[c]==0:
        ans=0 break;
    else if ans*A[c]>10000000000000000:
        ans=10000000000000001
    else :
        ans=ans*A[c]
    
    c+=1
    
if ans>10000000000000000: print(-1)
else: print(ans)

Fixed submission:
N = int(input())
A=list(map(int, input().split()))
 
ans=1
c=0
 
while c<N:
    if A[c]==0:
        ans=0
    elif ans*A[c]>1000000000000000000:
        ans=1000000000000000001
    else :
        ans=ans*A[c]
    
    c+=1
    
if ans>1000000000000000000: print(-1)
else: print(ans)

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

ans=1
c=0

while c<N:
    if A[c]==0: ans=0 break;
    else if ans*A[c]>10000000000000000: ans=10000000000000001
    else :
        ans=ans*A[c]
    
    c+=1
    
if ans>10000000000000000: print(-1)
else: print(ans)

Fixed submission:
N = int(input())
A=list(map(int, input().split()))
 
ans=1
c=0
 
while c<N:
    if A[c]==0:
        ans=0
    elif ans*A[c]>1000000000000000000:
        ans=1000000000000000001
    else :
        ans=ans*A[c]
    
    c+=1
    
if ans>1000000000000000000: print(-1)
else: print(ans)
Buggy python submission (verdict: Runtime Error):
from decimal import Decimal

A, B = list(map(float, input().split()))

ans = Decimal(A) * Decimal(B)

print(floor(ans))

Fixed submission:
from math import floor
from decimal import Decimal

A, B = list(input().split())

ans = int(A) * Decimal(B)

print(floor(ans))
Buggy python submission (verdict: Runtime Error):
from math import floor
from decimal import Decimal

S = int(input())

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

Fixed submission:
from math import floor
from decimal import Decimal

S = input()

if S[2] == S[3] and S[4] == S[5]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
A = [0] * 10

B = list(map(int, input().split()))
for i in range(len(B)):
    A[B[i]] += 1

for i in range(len(A)):
    if A[i] == 2:
        print('Yes')
        break
else 
    print('No')

Fixed submission:
A = [0] * 10

B = list(map(int, input().split()))
for i in range(len(B)):
    A[B[i]] += 1

for i in range(len(A)):
    if A[i] == 2:
        print('Yes')
        break
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = {}

MAX = 0
for i in range(N):
    s = input()
    A[s] = A.get(s,0) + 1
    MAX = max(MAX, A[s])

A = sorted(A.items())
for k,v in A.items():
  if MAX == v:
    print(k)

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

MAX = 0
for i in range(N):
    s = input()
    A[s] = A.get(s,0) + 1
    MAX = max(MAX, A[s])

B = sorted(A.items())
for k, v in B:
    if v == MAX:
        print(k)
Buggy python submission (verdict: Time Limit Exceeded):
import queue

H = int(input())

q = queue.Queue()
q.put(H)

c=0
while not q.empty():
    x = q.get()
    x = x // 2
    if x > 0:
        q.put(x)
        q.put(x)
    c+=1

print(c)

Fixed submission:
def dfs(h):
    if h == 1:
        return 1
    else:
        return dfs(h//2) * 2 + 1

H = int(input())

print(dfs(H))
Buggy python submission (verdict: Runtime Error):
K, X = list(map(int, input()))

if K * 500 >= X:
  	print('Yes')
else:
  	print('No')

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

if K * 500 >= X:
  	print('Yes')
else:
  	print('No')
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()

print(T + S)

Fixed submission:
S = list(map(str, input().split()))
 
print(S[1] + S[0])
Buggy python submission (verdict: Runtime Error):
N = input()
S, T = list(map(str, input().split()))

A = ''
for i in range(N):
    A += S[i]
    A += T[i]

print(A)

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

A = ''
for i in range(N):
    A += S[i]
    A += T[i]

print(A)