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

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
import fractions
mod = 10**9+7
lcm = A[0]
for i in range(1,N):
    lcm = lcm*A[i]//fractions.gcd(lcm,A[i])
ans = 0
for i in range(N):
    ans += lcm*pow(A[i],mod-2,mod)
print(ans%mod)

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

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
import fractions
mod = 10**9+7
lcm = A[0]
for i in range(1,N):
    lcm = lcm*A[i]//fractions.gcd(lcm,A[i])
ans = 0
for i in range(N):
    ans += lcm*pow(A[i],mod-2,mod)
print(ans%mod)

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

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
import fractions
mod = 10**9+7
lcm = A[0]
for i in range(1,N):
    lcm = lcm*A[i]//fractions.gcd(lcm,A[i])
ans = 0
for i in range(N):
    ans += lcm*pow(A[i],mod-2,mod)
print(ans%mod)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
import fractions
def lcm(a):
    x = a[0]
    for i in range(1,len(a)):
        x = (x*a[i])//fractions.gcd(x,a[i])
        return x
A_lcm = lcm(A)
ans = 0
for i in A:
    ans += (A_lcm//i)%mod
print(ans%mod)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
import fractions
mod = 10**9+7
lcm = A[0]
for i in range(1,N):
    lcm = lcm*A[i]//fractions.gcd(lcm,A[i])
ans = 0
for i in range(N):
    ans += lcm*pow(A[i],mod-2,mod)
print(ans%mod)

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = np.array(list(map(int,input().split())))
mod = 10**9+7
lcm = np.lcm.reduce(A)
for i in A:
    ans += (lcm//i)%mod
print(ans%mod)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
import fractions
mod = 10**9+7
lcm = A[0]
for i in range(1,N):
    lcm = lcm*A[i]//fractions.gcd(lcm,A[i])
ans = 0
for i in range(N):
    ans += lcm*pow(A[i],mod-2,mod)
print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
import fractions
from functools import reduce
mod = 10**9+7

def gcd(*numbers):
    return reduce(fractions.gcd,numbers)
def lcm_bace(x,y):
    return (x*y)//fractions.gcd(x,y)
def lcm(*numbers):
    return reduce(lcm_bace,numbers,1)

ans = 0
for i in A:
    ans += (lcm(*A)//i)%mod
print(ans%mod)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
import fractions
mod = 10**9+7
lcm = A[0]
for i in range(1,N):
    lcm = lcm*A[i]//fractions.gcd(lcm,A[i])
ans = 0
for i in range(N):
    ans += lcm*pow(A[i],mod-2,mod)
print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
import fractions
from functools import reduce
mod = 10**9+7

def gcd(numbers):
    return reduce(fractions.gcd,numbers)
def lcm_bace(x,y):
    return (x*y)//fractions.gcd(x,y)
def lcm(numbers):
    return reduce(lcm_bace,numbers,1)

A_lcm = lcm(A)
ans = 0
for i in A:
    ans += (A_lcm//i)%mod
print(ans%mod)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
import fractions
mod = 10**9+7
lcm = A[0]
for i in range(1,N):
    lcm = lcm*A[i]//fractions.gcd(lcm,A[i])
ans = 0
for i in range(N):
    ans += lcm*pow(A[i],mod-2,mod)
print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
import fractions
from functools import reduce
mod = 10**9+7

def gcd(*numbers):
    return reduce(fractions.gcd,numbers)
def lcm_bace(x,y):
    return (x*y)//fractions.gcd(x,y)
def lcm(*numbers):
    return reduce(lcm_bace,numbers,1)

A_lcm = lcm(*A)
ans = 0
for i in A:
    ans += (A_lcm//i)%mod
print(ans%mod)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
import fractions
mod = 10**9+7
lcm = A[0]
for i in range(1,N):
    lcm = lcm*A[i]//fractions.gcd(lcm,A[i])
ans = 0
for i in range(N):
    ans += lcm*pow(A[i],mod-2,mod)
print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
import fractions
from functools import reduce
mod = 10**9+7

def gcd(*numbers):
    return reduce(fractions.gcd,numbers)
def lcm_bace(x,y):
    return (x*y)//fractions.gcd(x,y)
def lcm(*numbers):
    return reduce(lcm_bace,numbers,1)

A_lcm = lcm(*A)
ans = 0
for i in A:
    ans += (A_lcm//i)%mod
print(ans%mod)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
import fractions
mod = 10**9+7
lcm = A[0]
for i in range(1,N):
    lcm = lcm*A[i]//fractions.gcd(lcm,A[i])
ans = 0
for i in range(N):
    ans += lcm*pow(A[i],mod-2,mod)
print(ans%mod)