Buggy python submission (verdict: Runtime Error):
from math import*
n=int(input())
mod=1000000007
s=[int(j) for j in input().split()]
ans=1
for i in s:
    ans*=i//gcd(ans,i)
print(sum(ans//i for i in s)%mod)


Fixed submission:
n=int(input())
a=[int(j) for j in input().split()]
t=1
mod=10**9+7
from fractions import*
for i in a:
    t*=i//gcd(t,i)
print(sum(t//i for i in a)%mod)

Buggy python submission (verdict: Runtime Error):
from math import*
n=int(input())
mod=1000000007
s=[int(j) for j in input().split()]
ans=1
for i in s:
    ans*=i//gcd(ans,i)
print(sum(ans//i for i in s)%mod)


Fixed submission:
n=int(input())
a=[int(j) for j in input().split()]
t=1
mod=10**9+7
from fractions import*
for i in a:
    t*=i//gcd(t,i)
print(sum(t//i for i in a)%mod)

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


Fixed submission:
n=int(input())
a=[int(j) for j in input().split()]
t=1
mod=10**9+7
from fractions import*
for i in a:
    t*=i//gcd(t,i)
print(sum(t//i for i in a)%mod)

Buggy python submission (verdict: Runtime Error):
import math
n=int(input())
mod=1000000007
sum=0
s=[int(n) for n in input().split()]
ans=1
for i in s:
    ans*=i//math.gcd(ans,i)
for i in s:
    sum=(sum+ans//i)%mod
print(sum)


Fixed submission:
n=int(input())
a=[int(j) for j in input().split()]
t=1
mod=10**9+7
from fractions import*
for i in a:
    t*=i//gcd(t,i)
print(sum(t//i for i in a)%mod)

Buggy python submission (verdict: Runtime Error):
import math
n=int(input())
mod=1000000007
ans=0
sum=0
s=[int(n) for n in input().split()]
ans=1
for i in s:
    ans*=i//math.gcd(ans,i)
for i in range(0, n):
    sum=(sum+ans//(s[i]))%mod
print(sum)


Fixed submission:
n=int(input())
a=[int(j) for j in input().split()]
t=1
mod=10**9+7
from fractions import*
for i in a:
    t*=i//gcd(t,i)
print(sum(t//i for i in a)%mod)

Buggy python submission (verdict: Time Limit Exceeded):
def gcd(a,b):
    if b==0:
        return a
    else:
        return gcd(b,a%b)
n=int(input())
mod=1000000007
ans=0
sum=0
s=[int(n) for n in input().split()]
for i in range(0, n):
    k=s[i]
    if i==0:
        ans=k
    else:
        u=ans
        ans = ((u * k) // gcd(u, k))
for i in range(0, n):
    sum=(sum+ans//(s[i]))%mod
print(sum)


Fixed submission:
n=int(input())
a=[int(j) for j in input().split()]
t=1
mod=10**9+7
from fractions import*
for i in a:
    t*=i//gcd(t,i)
print(sum(t//i for i in a)%mod)

Buggy python submission (verdict: Time Limit Exceeded):
def gcd(a,b):    #求最大公约数
    if b==0:
        return a
    else:
        return gcd(b,a%b)
a=[]
n=int(input())
mod=1000000007
ans=0
sum=0
s = [int(n) for n in input().split()]
#s=input().split(" ")
for i in range(0, n):
    k=s[i]
    if i==0:
        ans=k
    else:
        u=ans
        ans = ((u * k) // gcd(u, k))
for i in range(0, n):
    sum=(sum+ans//(int(s[i])))%mod
print(sum)


Fixed submission:
n=int(input())
a=[int(j) for j in input().split()]
t=1
mod=10**9+7
from fractions import*
for i in a:
    t*=i//gcd(t,i)
print(sum(t//i for i in a)%mod)

Buggy python submission (verdict: Time Limit Exceeded):
def gcd(a,b):    #求最大公约数
    if b==0:
        return a
    else:
        return gcd(b,a%b)
a=[]
n=int(input())
mod=1000000007
ans=0
sum=0
s=input().split(" ")
for i in range(0, n):
    k=int(s[i])
    if i==0:
        ans=k
    else:
        u=ans
        ans = ((u * k) // gcd(u, k))
#print(ans)
for i in range(0, n):
    sum=(sum+ans//(int(s[i])))%mod
print(sum)


Fixed submission:
n=int(input())
a=[int(j) for j in input().split()]
t=1
mod=10**9+7
from fractions import*
for i in a:
    t*=i//gcd(t,i)
print(sum(t//i for i in a)%mod)