Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
def lcm(a, b):
    return a * b // gcd(a, b)

n = int(input())
a = list(map(int,input().split()))
mod = 10 ** 9 + 7

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

ans = 0
for i in range(n):
    ans = (ans + LCM // a[i]) % mod
print(ans)

Fixed submission:
#E
n=int(input())
a=tuple(map(int,input().split()))
import fractions
lcm=a[0]
b_sum=0
for i in range(1,n):
    lcm=lcm*a[i]//fractions.gcd(lcm,a[i])

num=10**9+7
for i in range(n):
    b_sum+=(lcm//a[i])

print(b_sum%num)

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
def lcm(a, b):
    return a * b // gcd(a, b)

n = int(input())
a = list(map(int,input().split()))
mod = 10 ** 9 + 7

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

ans = 0
for i in range(n):
    ans = ans + LCM // a[i]
print(ans % mod)

Fixed submission:
#E
n=int(input())
a=tuple(map(int,input().split()))
import fractions
lcm=a[0]
b_sum=0
for i in range(1,n):
    lcm=lcm*a[i]//fractions.gcd(lcm,a[i])

num=10**9+7
for i in range(n):
    b_sum+=(lcm//a[i])

print(b_sum%num)

Buggy python submission (verdict: Time Limit Exceeded):
#E
n=int(input())
a=tuple(map(int,input().split()))
import fractions
lcm=a[0]
b_sum=0
for i in range(1,n):
    lcm=lcm*a[i]//fractions.gcd(lcm,a[i])

num=10**9+7
for i in range(n):
    b_sum+=(lcm//a[i])%num

print(b_sum%num)

Fixed submission:
#E
n=int(input())
a=tuple(map(int,input().split()))
import fractions
lcm=a[0]
b_sum=0
for i in range(1,n):
    lcm=lcm*a[i]//fractions.gcd(lcm,a[i])

num=10**9+7
for i in range(n):
    b_sum+=(lcm//a[i])

print(b_sum%num)

Buggy python submission (verdict: Runtime Error):
#E
n=int(input())
a=tuple(map(int,input().split()))
import fractions
lcm=a[0]
ans=1/a[0]
for i in range(1,n):
    lcm=lcm*a[i]//fractions.gcd(lcm,a[i])
    ans+=1/a[i]
num=10**9+7
print(int(ans*lcm)%num)

Fixed submission:
#E
n=int(input())
a=tuple(map(int,input().split()))
import fractions
lcm=a[0]
b_sum=0
for i in range(1,n):
    lcm=lcm*a[i]//fractions.gcd(lcm,a[i])

num=10**9+7
for i in range(n):
    b_sum+=(lcm//a[i])

print(b_sum%num)

Buggy python submission (verdict: Time Limit Exceeded):
#E
n=int(input())
a=tuple(map(int,input().split()))
import fractions
def lcm1(a,b):
    return a*b//fractions.gcd(a,b)

def main():
    lcm=a[0]
    b_sum=0
    
    for i in range(1,n):
        lcm=lcm1(lcm,a[i])

    num=10**9+7
    for i in range(n):
        b_sum+=(lcm//a[i])%num

    print(b_sum%num)

if __name__=='__main__':
    main()

Fixed submission:
#E
n=int(input())
a=tuple(map(int,input().split()))
import fractions
lcm=a[0]
b_sum=0
for i in range(1,n):
    lcm=lcm*a[i]//fractions.gcd(lcm,a[i])

num=10**9+7
for i in range(n):
    b_sum+=(lcm//a[i])

print(b_sum%num)

Buggy python submission (verdict: Time Limit Exceeded):
#E
n=int(input())
a=list(map(int,input().split()))
import fractions
lcm=a[0]
b_sum=0
for i in range(1,n):
    lcm=lcm*a[i]//fractions.gcd(lcm,a[i])

num=10**9+7
for i in range(n):
    b_sum+=(lcm//a[i])%num

print(b_sum%num)


Fixed submission:
#E
n=int(input())
a=tuple(map(int,input().split()))
import fractions
lcm=a[0]
b_sum=0
for i in range(1,n):
    lcm=lcm*a[i]//fractions.gcd(lcm,a[i])

num=10**9+7
for i in range(n):
    b_sum+=(lcm//a[i])

print(b_sum%num)

Buggy python submission (verdict: Time Limit Exceeded):
#E
n=int(input())
a=list(map(int,input().split()))
import fractions
lcm=a[0]
b_sum=0
for i in range(1,n):
    lcm=lcm*a[i]//fractions.gcd(lcm,a[i])

num=10**9+7
for i in range(n):
    b_sum+=(lcm//a[i])%num

print(b_sum%num)

Fixed submission:
#E
n=int(input())
a=tuple(map(int,input().split()))
import fractions
lcm=a[0]
b_sum=0
for i in range(1,n):
    lcm=lcm*a[i]//fractions.gcd(lcm,a[i])

num=10**9+7
for i in range(n):
    b_sum+=(lcm//a[i])

print(b_sum%num)