Buggy python submission (verdict: Time Limit Exceeded):
import fractions
 
n = int(input())
a = list(map(int, input().split()))
 
def lcm(x, y):
	return (x * y) // fractions.gcd(x, y)
 
num = a[0]
for i in range(1, n):
	num = lcm(num, a[i])
 
ans = 0
for i in range(n):
	ans += (num//a[i]) % 1000000007
	if ans > 1000000007:
		ans = ans%1000000007
 
print(ans)

Fixed submission:
import fractions
 
n = int(input())
a = list(map(int, input().split()))
 
l = 1
for i in range(n):
	l = l // fractions.gcd(l, a[i])*a[i]
 
ans = 0
for i in range(n):
	ans += l//a[i]
print(ans%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
import fractions
 
n = int(input())
a = list(map(int, input().split()))
 
l = 1
for i in range(n):
	l = l // fractions.gcd(l, a[i])*a[i]
 
ans = 0
for i in range(n):
	ans += l//a[i]
print(ans%(10**9+7))

Fixed submission:
import fractions
 
n = int(input())
a = list(map(int, input().split()))
 
l = 1
for i in range(n):
	l = l // fractions.gcd(l, a[i])*a[i]
 
ans = 0
for i in range(n):
	ans += l//a[i]
print(ans%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
import fractions
 
n = int(input())
a = list(map(int, input().split()))
 
num = 1
for i in range(n):
	num = num // fractions.gcd(num, a[i])*a[i]
 
ans = 0
for i in range(n):
	ans += (num//a[i])
print(ans%(10**9+7))

Fixed submission:
import fractions
 
n = int(input())
a = list(map(int, input().split()))
 
l = 1
for i in range(n):
	l = l // fractions.gcd(l, a[i])*a[i]
 
ans = 0
for i in range(n):
	ans += l//a[i]
print(ans%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
import fractions
 
n = int(input())
a = list(map(int, input().split()))
 
num = a[0]
for i in range(1, n):
	num = num // fractions.gcd(num, a[i])*a[i]
 
ans = 0
for i in range(n):
	ans += (num//a[i])
print(ans%(10**9+7))

Fixed submission:
import fractions
 
n = int(input())
a = list(map(int, input().split()))
 
l = 1
for i in range(n):
	l = l // fractions.gcd(l, a[i])*a[i]
 
ans = 0
for i in range(n):
	ans += l//a[i]
print(ans%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
import fractions
 
n = int(input())
a = list(map(int, input().split()))
 
num = a[0]
for i in range(1, n):
	num = num // fractions.gcd(num, a[i])*a[i]
 
ans = 0
for i in range(n):
	ans += (num//a[i])
print(ans%1000000007)

Fixed submission:
import fractions
 
n = int(input())
a = list(map(int, input().split()))
 
l = 1
for i in range(n):
	l = l // fractions.gcd(l, a[i])*a[i]
 
ans = 0
for i in range(n):
	ans += l//a[i]
print(ans%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
import fractions
 
n = int(input())
a = list(map(int, input().split()))
 
num = a[0]
for i in range(1, n):
	num = (num // fractions.gcd(num, a[i]))*a[i]
 
ans = 0
for i in range(n):
	ans += (num//a[i]) 
print(ans%1000000007)

Fixed submission:
import fractions
 
n = int(input())
a = list(map(int, input().split()))
 
l = 1
for i in range(n):
	l = l // fractions.gcd(l, a[i])*a[i]
 
ans = 0
for i in range(n):
	ans += l//a[i]
print(ans%(10**9+7))

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

num = a[0]
for i in range(1, n):
	num = (num // fractions.gcd(num, a[i]))*a[i]
 
ans = 0
for i in range(n):
	ans += (num//a[i]) % 1000000007
	if ans > 1000000007:
		ans = ans%1000000007
 
print(ans)

Fixed submission:
import fractions
 
n = int(input())
a = list(map(int, input().split()))
 
l = 1
for i in range(n):
	l = l // fractions.gcd(l, a[i])*a[i]
 
ans = 0
for i in range(n):
	ans += l//a[i]
print(ans%(10**9+7))

Buggy python submission (verdict: Runtime Error):
import fractions
 
n = int(input())
a = list(map(int, input().split()))
 
num = a[0]
for i in range(1, n):
	num = (num * a[i]) // fractions.gcd(num, a[i])
 
ans = 0
for i in range(n):
	ans += (num//a[i]) % 1000000007
 	if ans > 1000000007:
      	ans = ans % 1000000007
print(ans)

Fixed submission:
import fractions
 
n = int(input())
a = list(map(int, input().split()))
 
l = 1
for i in range(n):
	l = l // fractions.gcd(l, a[i])*a[i]
 
ans = 0
for i in range(n):
	ans += l//a[i]
print(ans%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
import fractions
 
n = int(input())
a = list(map(int, input().split()))
 
def lcm(x, y):
	return (x // fractions.gcd(x, y))*y
 
num = a[0]
for i in range(1, n):
	num = lcm(num, a[i])
 
ans = 0
for i in range(n):
	ans += (num//a[i]) % 1000000007
	if ans > 1000000007:
		ans = ans%1000000007
 
print(ans)

Fixed submission:
import fractions
 
n = int(input())
a = list(map(int, input().split()))
 
l = 1
for i in range(n):
	l = l // fractions.gcd(l, a[i])*a[i]
 
ans = 0
for i in range(n):
	ans += l//a[i]
print(ans%(10**9+7))

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

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

def lcm(x, y):
	return (x * y) // fractions.gcd(x, y)

num = a[0]
to = a[0]
for i in range(1, n):
	num = lcm(num, a[i])
	to *= a[i]

ans = 0
for i in range(n):
	ans += to//a[i]
print(((num*ans)//to)%1000000007)


Fixed submission:
import fractions
 
n = int(input())
a = list(map(int, input().split()))
 
l = 1
for i in range(n):
	l = l // fractions.gcd(l, a[i])*a[i]
 
ans = 0
for i in range(n):
	ans += l//a[i]
print(ans%(10**9+7))

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

def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)

def lcm(x, y):
	return (x * y) // gcd(x, y)

num = a[0]
for i in range(1, n):
	num = lcm(num, a[i])

ans = 0
for i in range(n):
	ans += (num//a[i]) % 1000000007
	if ans > 1000000007:
		ans = ans%1000000007

print(ans)

Fixed submission:
import fractions
 
n = int(input())
a = list(map(int, input().split()))
 
l = 1
for i in range(n):
	l = l // fractions.gcd(l, a[i])*a[i]
 
ans = 0
for i in range(n):
	ans += l//a[i]
print(ans%(10**9+7))

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

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

def lcm(x, y):
	return (x * y) // fractions.gcd(x, y)

num = a[0]
for i in range(1, n):
	num = lcm(num, a[i])

ans = 0
for i in range(n):
	ans += (num//a[i]) % 1000000007
	if ans > 1000000007:
		ans = ans%1000000007

print(ans)

Fixed submission:
import fractions
 
n = int(input())
a = list(map(int, input().split()))
 
l = 1
for i in range(n):
	l = l // fractions.gcd(l, a[i])*a[i]
 
ans = 0
for i in range(n):
	ans += l//a[i]
print(ans%(10**9+7))

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

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

def lcm(x, y):
	return (x * y) // math.gcd(x, y)

num = a[0]
for i in range(1, n):
	num = lcm(num, a[i])

ans = 0
for i in range(n):
	ans += (num//a[i]) % 1000000007
	if ans > 1000000007:
		ans = ans%1000000007

print(ans)

Fixed submission:
import fractions
 
n = int(input())
a = list(map(int, input().split()))
 
l = 1
for i in range(n):
	l = l // fractions.gcd(l, a[i])*a[i]
 
ans = 0
for i in range(n):
	ans += l//a[i]
print(ans%(10**9+7))