Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
v = []
m = [False for _ in range(9)]
for i in range(3):
    a, b, c = map(int, input().split())
    v += [a, b, c]

n = int(input())
for i in range(n):
    a = int(input())
    if a in v:
        m[v.index(a)] = True

def control():
    for i in range(3):
        if all(m[3*i:3*i+3]):
            return True
        if all(m[i::3]):
            return True

    if all(m[::4]) or all(m[2:8:2]):
        return True
    return False

print("Yes" if control() else "No")


Fixed submission:
import math

pages = input()
count = int(pages)

if count %2 == 0 :
    print(count/2)
else :
    print((count + 1)/2)

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

pages = input()
count = int(pages)

if count %2 = 0 :
    print(count/2)
else :
    print((count + 1)/2)


Fixed submission:
import math

pages = input()
count = int(pages)

if count %2 == 0 :
    print(count/2)
else :
    print((count + 1)/2)

Buggy python submission (verdict: Runtime Error):
pages = input()
count = int(pages)

if count %2 = 0 :
    print(count/2)
else :
    print((count + 1)/2)


Fixed submission:
import math

pages = input()
count = int(pages)

if count %2 == 0 :
    print(count/2)
else :
    print((count + 1)/2)

Buggy python submission (verdict: Runtime Error):
pages = input()
count = int(pages)

if count %2 = 0 :
    print(count/2)
else :
    print((count + 1)/2)


Fixed submission:
import math

pages = input()
count = int(pages)

if count %2 == 0 :
    print(count/2)
else :
    print((count + 1)/2)

Buggy python submission (verdict: Runtime Error):
pages = input()
count = int(pages)

if count %2 = 0 :
    print(count/2)

else :
    print((count + 1)/2)

Fixed submission:
import math

pages = input()
count = int(pages)

if count %2 == 0 :
    print(count/2)
else :
    print((count + 1)/2)
Buggy python submission (verdict: Runtime Error):
x, y = map(int, input().split())

#print(a ,type(a))
if x<10:
    print(y+(100*(10-x)))
else:
    print(y)


Fixed submission:
x, y = map(int, input().split())

#print(a ,type(a))
if x<10:
    print(y+(100*(10-x)))
else:
    print(y)

Buggy python submission (verdict: Runtime Error):

e = input()
R = input()

if int(e) >= 10:
     print(R)
else :
     K = 100 * (10 - int(e))
     print(K)


Fixed submission:
x, y = map(int, input().split())

#print(a ,type(a))
if x<10:
    print(y+(100*(10-x)))
else:
    print(y)

Buggy python submission (verdict: Runtime Error):
 N = input()
 R = input()
 if N >= 10:
     print(R)
 else :
     K = 100 * (10 - int(N))
     print(K)


Fixed submission:
x, y = map(int, input().split())

#print(a ,type(a))
if x<10:
    print(y+(100*(10-x)))
else:
    print(y)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()

#Y = len(S.replace('ABC',''))
#print((N-Y)//3)

print(S.count('ABC'))


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

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

for i in range(25)
    for j in range(15)
        if N == 4*i + 7*j:
            print('Yes')
            break

print('No')


Fixed submission:
N = int(input())

for i in range(25):
    for j in range(15):
        if N == 4*i + 7*j:
            print('Yes')
            exit()

print('No')
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()

if sorted(s) < sorted(t, reverse=True):
    print('Yes')
else:
    print('No')


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

if (a + b) %2 ==0:
    print(int((a+b)/2))
else:
    print(int((a+b+1)//2))
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()

s1 = s.sort()
t1 = t.sort(reserve = True)

if s1 < t1:
    print('Yes')
else:
    print('No')


Fixed submission:
s = sorted((input()))
t = sorted((input()), reverse=True)

if s<t:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

cnt =0

while True:
    if [i for i in A if i%2 == 1]:
        break
    A = [i/2 for i in A if i%2 ==0]
    cnt += 1
    
prnt(cnt)


Fixed submission:
S = input()
print(S.count('1'))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

cnt =0

while True:
    if [i for i in A if i%2 == 1]:
        break
    A = [i/2 for i in A if i%2 ==0]
    cnt += 1
    
prnt(cnt)


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

cnt =0

while True:
    if [i for i in A if i%2 == 1]:
        break
    A = [i/2 for i in A if i%2 ==0]
    cnt += 1

print(cnt)
Buggy python submission (verdict: Runtime Error):
r, g, b = map(int, input().split())
num = int(str(r)+str(g)+str(b)

if  num %4 == 0:
    print('YES')
else:
    print('NO')


Fixed submission:
r, g, b = map(int, input().split())
num = int(str(r)+str(g)+str(b))

if  num %4 == 0:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())


def judge():
    ans="-"*n
    for i in range(m):
        s,c = map(int,input().split())
        if ans[s-1]!="-" and int(ans[s-1])!=c:
            return -1
        else:
            a = list(ans)
            a[s-1] = str(c)
            ans = "".join(a)
    ans=ans.replace("-","0")
    if ans[s-1]==str(0):
        if n==1:
            return 0
        else:
            return -1
    return ans

print(judge())

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


def judge():
    ans="-"*n
    if m==0:
        if n==1:
            return 0
    for i in range(m):
        s,c = map(int,input().split())
        if ans[s-1]!="-" and int(ans[s-1])!=c:
            return -1
        else:
            a = list(ans)
            a[s-1] = str(c)
            ans = "".join(a)
    if ans[0]=="-":
        a=list(ans)
        a[0]="1"
        ans="".join(a)
    ans=ans.replace("-","0")
    # print(ans[0])
    if ans[0]==str(0):
        if n==1:
            return 0
        else:
            return -1
    return ans

print(judge())

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


def judge():
    ans="-"*n
    for i in range(m):
        s,c = map(int,input().split())
        if ans[s-1]!="-" and int(ans[s-1])!=c:
            return -1
        else:
            a = list(ans)
            a[s-1] = str(c)
            ans = "".join(a)
    ans=ans.replace("-","0")
    if ans[s-1]==str(0):
        if n==0:
            return 0
        else:
            return -1
    return ans

print(judge())

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


def judge():
    ans="-"*n
    if m==0:
        if n==1:
            return 0
    for i in range(m):
        s,c = map(int,input().split())
        if ans[s-1]!="-" and int(ans[s-1])!=c:
            return -1
        else:
            a = list(ans)
            a[s-1] = str(c)
            ans = "".join(a)
    if ans[0]=="-":
        a=list(ans)
        a[0]="1"
        ans="".join(a)
    ans=ans.replace("-","0")
    # print(ans[0])
    if ans[0]==str(0):
        if n==1:
            return 0
        else:
            return -1
    return ans

print(judge())
Buggy python submission (verdict: Time Limit Exceeded):
dp = [[[False] * 30009 for i in range(4)] for j in range(1009)]
dp[0][0][0]=True
cnt=0
for i in range(n):
    for j in range(4):
        for k in range(1000):
            if dp[i][j][k] == False:
                continue
            dp[i+1][j][k] = True
            if(j<=2):
                dp[i+1][j+1][k*10+int(s[i])]=True
for i in range(1000):
    if(dp[n][3][i]==True):
        cnt+=1
print(cnt)

Fixed submission:
n = int(input())
s = input()
count = 0
for i in range(1000):
    v = str(i).zfill(3)
    k=0
    for j in range(n):
        if v[k] == s[j]:
            k+=1
        if k==3:
            count+=1
            break

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
# resolve after read answer

n = int(input())
s = input()

# count = 0
# for i in range(1000):
#     v = str(i).zfill(3)
#     k=0
#     for j in range(n):
#         if v[k] == s[j]:
#             k+=1
#         if k==3:
#             count+=1
#             break

# print(count)

# dp
dp = [[[False] * 30009 for i in range(4)] for j in range(1009)]
dp[0][0][0]=True
cnt=0
for i in range(n):
    for j in range(4):
        for k in range(1000):
            if dp[i][j][k] == False:
                continue
            dp[i+1][j][k] = True
            if(j<=2):
                dp[i+1][j+1][k*10+int(s[i])]=True
    for i in range(1000):
        if(dp[n][3][i]==True):
            cnt+=1
print(cnt)


Fixed submission:
n = int(input())
s = input()
count = 0
for i in range(1000):
    v = str(i).zfill(3)
    k=0
    for j in range(n):
        if v[k] == s[j]:
            k+=1
        if k==3:
            count+=1
            break

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
count = 0
for i in range(1000):
    v = str(i).zfill(3)
    k=0
    for j in range(n):
        if v[k] == s[j]:
            k+=1
        if k==3:
            count+=1
            break

print(count)

Fixed submission:
n = int(input())
s = input()
count = 0
for i in range(1000):
    v = str(i).zfill(3)
    k=0
    for j in range(n):
        if v[k] == s[j]:
            k+=1
        if k==3:
            count+=1
            break

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

count=0

for i in range(n):
    count+=i

print(count)

Fixed submission:
n = int(input())

n-=1

print(n*(n+1)//2)
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**6)
n,q = map(int,input().split())
a=[[] for i in range(n)]
p=[]*n
l=[0]*n
ans=[0]*n

def dfs(parent,current,value):
    value += l[current]
    ans[current] = value
    for i in a[current]:
        if i == parent:
            continue
        dfs(current,i,value)


for i in range(n-1):
    t1,t2 = map(int,input().split())
    a[t1-1].append(t2-1)
    a[t2-1].append(t1-1)
    
for i in range(q):
    t1,t2 = map(int,input().split())
    l[t1-1]+=t2
dfs(-1,0,0)

print(" ".join(map(str,ans)))

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


if a>=3200:
    print(s)
else:
    print("red")
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**6)
n,q = map(int,input().split())
a=[[] for i in range(n)]
p=[]*n
l=[0]*n

def dfs(parent,current):
    for i in a[current-1]:
        if i != parent:
            l[i-1] += l[current-1]
            dfs(current,i)


for i in range(n-1):
    t1,t2 = map(int,input().split())
    a[t1-1].append(t2)
    a[t2-1].append(t1)
    
for i in range(q):
    t1,t2 = map(int,input().split())
    l[t1-1]+=t2
dfs(-1,1)

print(" ".join(map(str,l)))

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

v = sorted(v)
# print(v)
def dfs (l):
    if len(l)==1:
         return l[0]
    num = (l[0]+l[1])/2.0
    l = l[2:]
    # print(l)
    l.append(num)
    # print(l)
    l = sorted(l)
    return dfs(l)



print(dfs(v))
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(100000)
nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

n = int(input())
s=[]
m={}
sum=0
for i in range(0,n):
    # print((list(input()))
    tmp = "".join(sorted(input()))
    if tmp in m:
        m[tmp]+=1
    else:
        m[tmp] = 1
for k in m:
    if m[k]>1:
        # print(m[k])
        # print("["+k)
        sum+=cmb(m[k],2)
print(sum)



Fixed submission:
import sys
sys.setrecursionlimit(10000000)
nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

n = int(input())
s=[]
m={}
sum=0
for i in range(0,n):
    # print((list(input()))
    tmp = "".join(sorted(input()))
    if tmp in m:
        m[tmp]+=1
    else:
        m[tmp] = 1
for k in m:
    if m[k]>1:
        # print(m[k])
        # print("["+k)
        sum+=cmb(m[k],2)
print(sum)

Buggy python submission (verdict: Runtime Error):
nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

n = int(input())
s=[]
m={}
sum=0
for i in range(0,n):
    # print((list(input()))
    tmp = "".join(sorted(input()))
    if tmp in m:
        m[tmp]+=1
    else:
        m[tmp] = 1
for k in m:
    if m[k]>1:
        # print(m[k])
        # print("["+k)
        sum+=cmb(m[k],2)
print(sum)


Fixed submission:
import sys
sys.setrecursionlimit(10000000)
nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

n = int(input())
s=[]
m={}
sum=0
for i in range(0,n):
    # print((list(input()))
    tmp = "".join(sorted(input()))
    if tmp in m:
        m[tmp]+=1
    else:
        m[tmp] = 1
for k in m:
    if m[k]>1:
        # print(m[k])
        # print("["+k)
        sum+=cmb(m[k],2)
print(sum)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
h=list(map(int,input().split()))

maxh = [i for i, x in enumerate(h) if x==max(h)]
minh = [i for i, x in enumerate(h) if x==min(h)]

if min(maxh)<max(minh) and max(h)-1>min(h):
    print("No")
else:
    print("Yes")

Fixed submission:
n = int(input())
h=list(map(int,input().split()))
def jud(n,h):
    for i in list(reversed(range(0,n-1))):
        # print(h[i],h[i+1])
        if h[i+1]-h[i]==-1:
            h[i]-=1
            # print(h[i])
            continue
        if h[i]-h[i+1]>1:
            return "No"
            break
    return "Yes"

print(jud(n,h))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a=[]
for i in range(n):
    a.append(int(input()))

for i in range(1,n+1):
    tmp = a[:i-1]+a[i:]
    # print(tmp)
    print(max(tmp))


Fixed submission:
n = int(input())
first=(0,0)
second=0
for i in range(n):
    num = int(input())
    if num>= first[0]:
        second = first[0]
        first=(num,i)
    elif num>=second:
        second = num
# print(n)
for i in range(n):
    if i==first[1]:
        print(second)
    else:
        print(first[0])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a=[]
for i in range(n):
    a.append(int(input()))

for i in range(1,n+1):
    tmp = a[:i-1]+a[i:]
    # print(tmp)
    print(max(tmp))


Fixed submission:
n = int(input())
first=(0,0)
second=0
for i in range(n):
    num = int(input())
    if num>= first[0]:
        second = first[0]
        first=(num,i)
    elif num>=second:
        second = num
# print(n)
for i in range(n):
    if i==first[1]:
        print(second)
    else:
        print(first[0])
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())

a=[]
b=[]
cnt=0
sum=0


for i in range(0,n):
    ta,tb = map(int,input().split())
    a.append(ta)
    b.append(tb)


while m>0:
    mindex = a.index(min(a))
    num = m if m<b[mindex] else b[mindex]
    sum+=a[mindex]*num
    m-=num
    del b[mindex]
    del a[mindex]



print(sum)

Fixed submission:
n,m = map(int,input().split())
data = []
sum=0


for i in range(0,n):
    a,b = map(int,input().split())
    data.append((a,b))

data.sort()

while m>0:
    num = m if m<data[0][1] else data[0][1]
    sum+=data[0][0]*num
    m-=num
    del data[0]

print(sum)

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

a=[]
b=[]
cnt=0
sum=0

for i in range(0,n):
    ta,tb = map(int,input().split())
    a.append(ta)
    b.append(tb)


while m>0:
    mindex = a.index(min(a))
    sum+=a[mindex]*b[mindex]
    m-=b[mindex]
    sa = a[mindex]
    del b[mindex]
    del a[mindex]

while m<0:
    m+=1
    sum-=sa

print(sum)

Fixed submission:
n,m = map(int,input().split())
data = []
sum=0


for i in range(0,n):
    a,b = map(int,input().split())
    data.append((a,b))

data.sort()

while m>0:
    num = m if m<data[0][1] else data[0][1]
    sum+=data[0][0]*num
    m-=num
    del data[0]

print(sum)

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

a=[]
b=[]
cnt=0
sum=0

for i in range(0,n):
    ta,tb = map(int,input().split())
    a.append(ta)
    b.append(tb)


while m>0:
    mindex = a.index(min(a))
    for i in range(0,b[mindex]):
        sum+=a[mindex]
        m-=1
        if m<=0:
            break
    del b[mindex]
    del a[mindex]

print(sum)

Fixed submission:
n,m = map(int,input().split())
data = []
sum=0


for i in range(0,n):
    a,b = map(int,input().split())
    data.append((a,b))

data.sort()

while m>0:
    num = m if m<data[0][1] else data[0][1]
    sum+=data[0][0]*num
    m-=num
    del data[0]

print(sum)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
origin = s
past = ''
cnt=0
while True:
    past = s
    s = s.replace('10','').replace('01','')
#    print(s)
#    print(past)
    if past==s:
        break

num = len(origin)-len(s)
print(num)

Fixed submission:
s = input()
a = s.count('1')
b = s.count('0')

num = min(a,b)*2
print(num)

Buggy python submission (verdict: Runtime Error):
s = input()
origin = s
past = ''
cnt=0
while True:
    past = s
    s = s.replace('10','').replace('01','')
    print(s)
    print(past)
    if past==s:
        break

num = len(origin)-len(s)
print(num)

Fixed submission:
s = input()
a = s.count('1')
b = s.count('0')

num = min(a,b)*2
print(num)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
origin = s
length = len(s)
past = ''
cnt=0
while s != past:
    past = s
    s = s.replace('10','').replace('01','')

num = len(origin)-len(s)
print(num)

Fixed submission:
s = input()
a = s.count('1')
b = s.count('0')

num = min(a,b)*2
print(num)
Buggy python submission (verdict: Runtime Error):
a=[]
a=[int(x) for x in input().split()]

ans = list.index(0) + 1
print(ans)

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

ans = a.index(0) + 1
print(ans)
Buggy python submission (verdict: Runtime Error):
x, y = int(input().split())

max_num = 4 * x
min_num = 2 * x

if y % 2 == 1:
    print('No')
elif (min_num <= y) and (max_num >= y):
    print('Yes')
else:
    print('No')

Fixed submission:
x, y =  map(int, input().split())

max_num = 4 * x
min_num = 2 * x

if y % 2 == 1:
    print('No')
elif (min_num <= y) and (max_num >= y):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
x, y = input().split()

max_num = 4 * x
min_num = 2 * x

if y % 2 == 1:
    print('No')
elif (min_num <= y) and (max_num >= y):
    print('Yes')
else:
    print('No')

Fixed submission:
x, y =  map(int, input().split())

max_num = 4 * x
min_num = 2 * x

if y % 2 == 1:
    print('No')
elif (min_num <= y) and (max_num >= y):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
x, y = input().split()

if y % 2 == 1:
    print('No')

max_num = 4 * x
min_num = 2 * x

if (min_num <= y) and (max_num >= y):
    print('Yes')
else:
    print('No')

Fixed submission:
x, y =  map(int, input().split())

max_num = 4 * x
min_num = 2 * x

if y % 2 == 1:
    print('No')
elif (min_num <= y) and (max_num >= y):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
import numpy as np
x, n = map(int, input().split())
num_list = list(map(int,input().split()))
num_list = sorted(num_list)
num_100 = list(range(1, 101))

for num in num_list:
    numbers = num_100.remove(num)

numbers1 = np.array(numbers)
numbers2 = numbers - x
numbers3 = np.abs(numbers)
min_index = numbers.argmin()
print(numbers1[min_index])

Fixed submission:
import numpy as np
x, n = map(int, input().split())
num_list = list(map(int,input().split()))
num_list = sorted(num_list)
num_100 = list(range(-100, 102))

if n ==0:
    print(x)
else:
 for num in num_list:
     num_100.remove(num)

 numbers1 = np.array(num_100)
 numbers2 = numbers1 - x
 numbers3 = np.abs(numbers2)
 min_index = numbers3.argmin()
 print(numbers1[min_index])

Buggy python submission (verdict: Runtime Error):
import numpy as np
x, n = map(int, input().split())
num_list = list(map(int,input().split()))
num_100 = list(range(1, 101))

for num in num_list:
    numbers = num_100.remove(num)

numbers1 = np.array(numbers)
numbers2 = numbers - x
numbers3 = np.abs(numbers)
min_index = numbers.argmin()
print(numbers1[min_index])

Fixed submission:
import numpy as np
x, n = map(int, input().split())
num_list = list(map(int,input().split()))
num_list = sorted(num_list)
num_100 = list(range(-100, 102))

if n ==0:
    print(x)
else:
 for num in num_list:
     num_100.remove(num)

 numbers1 = np.array(num_100)
 numbers2 = numbers1 - x
 numbers3 = np.abs(numbers2)
 min_index = numbers3.argmin()
 print(numbers1[min_index])
Buggy python submission (verdict: Runtime Error):
a, b = int(input().split())
print(a * b)

Fixed submission:
a, b = (int(x) for x in input().split())
print(a * b)

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

Fixed submission:
a, b = (int(x) for x in input().split())
print(a * b)

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

Fixed submission:
a, b = (int(x) for x in input().split())
print(a * b)

Buggy python submission (verdict: Runtime Error):
int(A * B)

Fixed submission:
a, b = (int(x) for x in input().split())
print(a * b)

Buggy python submission (verdict: Runtime Error):
A * B

Fixed submission:
a, b = (int(x) for x in input().split())
print(a * b)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = input().split()
a_int = [int(n) for n in a]
ans = 1
for num in a_int:
    if ans !> 10**18:
        ans *= num
    else:
        print(-1)
print(ans)

Fixed submission:
N = int(input())
A = map(int, input().split())
 
res = 1
 
for a in sorted(A):
    res *= a
    if res > 10 ** 18:
        print("-1")
        exit()
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = input().split()
a_int = [int(n) for n in a]
ans = 1
if 0 in a_int:
    print(0)
else:
 for num in a_int:
     ans *= num
 if ans > 10**18:
     print(-1)
 else:
     print(ans)

Fixed submission:
N = int(input())
A = map(int, input().split())
 
res = 1
 
for a in sorted(A):
    res *= a
    if res > 10 ** 18:
        print("-1")
        exit()
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = input().split()
a_int = [int(n) for n in a]
ans = 1
for num in a_int:
    ans *= num
if ans > 10**18:
    print(-1)
else:
    print(ans)

Fixed submission:
N = int(input())
A = map(int, input().split())
 
res = 1
 
for a in sorted(A):
    res *= a
    if res > 10 ** 18:
        print("-1")
        exit()
print(res)

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

ans = 1
for a in a_nums:
  ans *= a
if ans > 10**18:
  ans = -1
print(ans)

Fixed submission:
N = int(input())
A = map(int, input().split())
 
res = 1
 
for a in sorted(A):
    res *= a
    if res > 10 ** 18:
        print("-1")
        exit()
print(res)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = []
a = input().split()
b = 1
for num in range(n):
  b = b * a[num]
if b > 10**18:
  b = -1
print(b)

Fixed submission:
N = int(input())
A = map(int, input().split())
 
res = 1
 
for a in sorted(A):
    res *= a
    if res > 10 ** 18:
        print("-1")
        exit()
print(res)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = []
a = input().split()
b = 1
for num in a:
  b = b * num
if b > 10**18:
  b = -1
print(b)

Fixed submission:
N = int(input())
A = map(int, input().split())
 
res = 1
 
for a in sorted(A):
    res *= a
    if res > 10 ** 18:
        print("-1")
        exit()
print(res)