Buggy python submission (verdict: Time Limit Exceeded):
# E
from fractions import gcd

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

value = 1
for a in A:
    value = value * a // gcd(value, a)

mod = 10**9+7

ans = 0
for i in A:
    ans += value * pow(i, mod-2,mod)
    ans = ans % mod

print(ans)


Fixed submission:
# E
from fractions import gcd

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

value = 1
for a in A:
    value = value * a // gcd(value, a)

mod = 10**9+7

ans = 0
for i in A:
    ans += value // i

print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
# E
from fractions import gcd

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

value = 1
for a in A:
    value = value * a // gcd(value, a)

mod = 10**9+7

ans = 0
for i in A:
    ans += value * pow(i, mod-2,mod)
    ans = ans % mod

print(ans)


Fixed submission:
# E
from fractions import gcd

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

value = 1
for a in A:
    value = value * a // gcd(value, a)

mod = 10**9+7

ans = 0
for i in A:
    ans += value // i

print(ans%mod)

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

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

value = 1
for a in A:
    value = value * a // fractions.gcd(value, a)

mod = 10**9+7

ans = 0
for i in A:
    ans += value * pow(i, mod-2,mod)
    ans = ans % mod

print(ans)


Fixed submission:
# E
from fractions import gcd

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

value = 1
for a in A:
    value = value * a // gcd(value, a)

mod = 10**9+7

ans = 0
for i in A:
    ans += value // i

print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
# E
import fractions
N = int(input()) 
A = list(map(int, input().split()))

value = A[0]
for i in range(1, N):
    value = value * A[i] // fractions.gcd(value, A[i])

mod = 10**9+7
ans = 0
for i in A:
    ans += value * pow(i, mod-2,mod)
    ans = ans % mod

print(ans)


Fixed submission:
# E
from fractions import gcd

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

value = 1
for a in A:
    value = value * a // gcd(value, a)

mod = 10**9+7

ans = 0
for i in A:
    ans += value // i

print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
# E
import fractions
N = int(input()) 
A = list(map(int, input().split()))

value = A[0]
for i in range(1, N):
    value = value * A[i] // fractions.gcd(value, A[i])

z = 10**9+7
ans = 0
for i in A:
    ans += (value//i) % z

print(ans % z)


Fixed submission:
# E
from fractions import gcd

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

value = 1
for a in A:
    value = value * a // gcd(value, a)

mod = 10**9+7

ans = 0
for i in A:
    ans += value // i

print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
# E
import fractions
N = int(input()) 
A = list(map(int, input().split()))

def main():
    value = A[0]
    for i in range(1, N):
        value = value * A[i] // fractions.gcd(value, A[i])

    z = 10**9+7
    ans = 0
    for i in A:
        ans += (value//i) % z

    print(ans % z)

if __name__ == '__main__':
    main()

Fixed submission:
# E
from fractions import gcd

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

value = 1
for a in A:
    value = value * a // gcd(value, a)

mod = 10**9+7

ans = 0
for i in A:
    ans += value // i

print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
# E
import fractions
N = int(input()) 
A = list(map(int, input().split()))

value = A[0]
for i in range(1, N):
    value = value * A[i] // fractions.gcd(value, A[i])

z = 10**9+7
ans = 0
for i in A:
    ans += (value//i) % z

print(ans % z)

Fixed submission:
# E
from fractions import gcd

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

value = 1
for a in A:
    value = value * a // gcd(value, a)

mod = 10**9+7

ans = 0
for i in A:
    ans += value // i

print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
# E
import fractions
N = int(input()) 
A = list(map(int, input().split()))

value = A[0]
for i in range(1, N):
    value = value * A[i] // fractions.gcd(value, A[i])

ans = 0
for i in A:
    ans += (value//i) % (10**9+7)

print(ans % (10**9+7))

Fixed submission:
# E
from fractions import gcd

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

value = 1
for a in A:
    value = value * a // gcd(value, a)

mod = 10**9+7

ans = 0
for i in A:
    ans += value // i

print(ans%mod)

Buggy python submission (verdict: Runtime Error):
# E
import numpy as np
N = int(input()) 
A = list(map(int, input().split()))

lcm = np.lcm.reduce(A)

ans = 0
for i in A:
    ans += (lcm//i) % (10**9+7)

print(ans % (10**9+7))

Fixed submission:
# E
from fractions import gcd

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

value = 1
for a in A:
    value = value * a // gcd(value, a)

mod = 10**9+7

ans = 0
for i in A:
    ans += value // i

print(ans%mod)

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

lcm = np.lcm.reduce(A)

ans = 0
for i in A:
    ans += (lcm//i) % (10**9+7)

print(ans % (10**9+7))

Fixed submission:
# E
from fractions import gcd

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

value = 1
for a in A:
    value = value * a // gcd(value, a)

mod = 10**9+7

ans = 0
for i in A:
    ans += value // i

print(ans%mod)