Buggy python submission (verdict: Runtime Error):
n = int(input())
num = list(map(int, input().split()))
limit = 10**18
 
num.sort()
result = A[0]
 
for i in num[1:]:
    result *= i
    if result > limit:
        exit()
        
print(result)

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

limit = 10 ** 18
A.sort()
result = A[0]
for a in A[1:]:
    result *= a
    if result > limit:
        print(-1)
        exit()
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import Fraction
import numpy as np

n = int(input())
num = list(map(int, input().split()))
num = [ Fraction(i) for i in num ]
num = np.array(num)

if 0 in num:
    print(0)
else:
    mult = np.prod(num)
    if mult > 10**18:
        print(-1)
    else:
        print(int(mult))

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

limit = 10 ** 18
A.sort()
result = A[0]
for a in A[1:]:
    result *= a
    if result > limit:
        print(-1)
        exit()
print(result)

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

n = int(input())
num = list(map(int, input().split()))
num = [ Fraction(i) for i in num ]

if 0 in num:
    print(0)
else:
    mult = reduce(lambda x, y: x*y, num)
    if mult > 10**18:
        print(-1)
    else:
        print(int(mult))

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

limit = 10 ** 18
A.sort()
result = A[0]
for a in A[1:]:
    result *= a
    if result > limit:
        print(-1)
        exit()
print(result)

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

n = int(input())
num = list(map(int, input().split()))
num = [ Fraction(i) for i in num ]

if 0 in num:
    print(0)
elif len([i for i in num if i >= 10**18]) != 0:
    print(-1)
else:
    mult = reduce(lambda x, y: x*y, num)
    if mult > 10**18:
        print(-1)
    else:
        print(int(mult))

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

limit = 10 ** 18
A.sort()
result = A[0]
for a in A[1:]:
    result *= a
    if result > limit:
        print(-1)
        exit()
print(result)

Buggy python submission (verdict: Runtime Error):
from fractions import Fraction
import math

n = int(input())
num = list(map(int, input().split()))
num = [ Fraction(i) for i in num ]

if 0 in num:
    print(0)
elif len([i for i in num if i >= 10**18]) != 0:
    print(-1)
else:
    mult = math.prod(num)
    if mult > 10**18:
        print(-1)
    else:
        print(int(mult))

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

limit = 10 ** 18
A.sort()
result = A[0]
for a in A[1:]:
    result *= a
    if result > limit:
        print(-1)
        exit()
print(result)

Buggy python submission (verdict: Runtime Error):
from fractions import Fraction
import numpy

n = int(input())
num = list(map(int, input().split()))
num = [ Fraction(i) for i in num ]

if 0 in num:
    print(0)
elif len([i for i in num if i >= 10**18]) != 0:
    print(-1)
else:
    mult = numpy.prod(num)
    if mult > 10**18:
        print(-1)
    else:
        print(int(mult))

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

limit = 10 ** 18
A.sort()
result = A[0]
for a in A[1:]:
    result *= a
    if result > limit:
        print(-1)
        exit()
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import Fraction
import numpy

n = int(input())
num = list(map(int, input().split()))
num = [ Fraction(i) for i in num ]

if 0 in num:
    print(0)
elif len([i for i in num if i >= 10**18]) != 0:
    print(-1)
else:
    mult = numpy.prod(num)
    if mult > 10**18:
        print(-1)
    else:
        print(int(mult))

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

limit = 10 ** 18
A.sort()
result = A[0]
for a in A[1:]:
    result *= a
    if result > limit:
        print(-1)
        exit()
print(result)

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

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

if 0 in num:
    print(0)
elif len([i for i in num if i >= 10**18]) != 0:
    print(-1)
else:
    mult = numpy.prod(num)
    if mult > 10**18:
        print(-1)
    else:
        print(mult)

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

limit = 10 ** 18
A.sort()
result = A[0]
for a in A[1:]:
    result *= a
    if result > limit:
        print(-1)
        exit()
print(result)

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

n = int(input())

num = [None] * n
num = list(map(int, input().split()))

if 0 in num:
    print(0)
else:
    mult = numpy.prod(num)
    if mult > 10**18:
        print(-1)
    else:
        print(mult)

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

limit = 10 ** 18
A.sort()
result = A[0]
for a in A[1:]:
    result *= a
    if result > limit:
        print(-1)
        exit()
print(result)

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

n = int(input())

num = [0] * n
num = list(map(int, input().split()))

if 0 in num:
    print(0)
else:
    mult = numpy.prod(num)
    if mult > 10**18:
        print(-1)
    else:
        print(mult)

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

limit = 10 ** 18
A.sort()
result = A[0]
for a in A[1:]:
    result *= a
    if result > limit:
        print(-1)
        exit()
print(result)