Buggy python submission (verdict: Runtime Error):
def gcd(a,b):
    while b:a,b=a,a%b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)

N = int(input())
A = tuple(map(int,input().split(" ")))
ans = 0
mod = 10**9+7
l = 1
for i in range(N):
    l = lcm(l,A[i])
l %= mod

for i in A:
    ans += l//A[i]
    ans %= mod

print(ans)

Fixed submission:
def gcd(a,b):
    while b:a,b=b,a%b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)

N = int(input())
A = tuple(map(int,input().split(" ")))
ans = 0
mod = 10**9+7
l = 1
for i in range(N):
    l = lcm(l,A[i])
l %= mod

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

print(ans)

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

def lcm(a):
    ans = a[0]
    
    for i in range(1,len(a)):
        ans = (ans//gcd(ans,a[i]))*a[i]
    
    return ans

N = int(input())
A = list(map(int,input().split(" ")))
g = lcm(A)
ans = 0
mod = 10**9+7

for i in A:
    ans += (g//i)%(mod)

print(ans%mod)

Fixed submission:
def gcd(a,b):
    while b:a,b=b,a%b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)

N = int(input())
A = tuple(map(int,input().split(" ")))
ans = 0
mod = 10**9+7
l = 1
for i in range(N):
    l = lcm(l,A[i])
l %= mod

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

print(ans)

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

def lcm(a):
    ans = a[0]
    
    for i in range(1,len(a)):
        ans = (ans//gcd(ans,a[i]))*a[i]
    
    return ans

N = int(input())
A = tuple(map(int,input().split(" ")))
g = lcm(A)
ans = 0
mod = 10**9+7

for i in A:
    ans += (g//i)%(mod)

print(ans%mod)

Fixed submission:
def gcd(a,b):
    while b:a,b=b,a%b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)

N = int(input())
A = tuple(map(int,input().split(" ")))
ans = 0
mod = 10**9+7
l = 1
for i in range(N):
    l = lcm(l,A[i])
l %= mod

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

print(ans)

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

def lcm(a):
    ans = a[0]
    for i in range(1,len(a)):
        ans = (ans//gcd(ans,a[i]))*a[i]
    return ans

N = int(input())
A = tuple(map(int,input().split(" ")))
g = lcm(A)
ans = 0
for i in A:
    ans += g//i
    ans %= (10**9+7)

print(ans)

Fixed submission:
def gcd(a,b):
    while b:a,b=b,a%b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)

N = int(input())
A = tuple(map(int,input().split(" ")))
ans = 0
mod = 10**9+7
l = 1
for i in range(N):
    l = lcm(l,A[i])
l %= mod

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

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
N = int(input())
A = [0 for _ in range(N)]
g = 0
for i,a in enumerate(map(int,input().split(" "))):
    A[i] = a
    if i == 0:
        g = a
    g = g*a//gcd(a,g)
ans = 0
A = tuple(A)
for a in A:
    ans += g//a
    ans %= (10**9+7)
print(ans)

Fixed submission:
def gcd(a,b):
    while b:a,b=b,a%b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)

N = int(input())
A = tuple(map(int,input().split(" ")))
ans = 0
mod = 10**9+7
l = 1
for i in range(N):
    l = lcm(l,A[i])
l %= mod

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

print(ans)

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

Fixed submission:
def gcd(a,b):
    while b:a,b=b,a%b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)

N = int(input())
A = tuple(map(int,input().split(" ")))
ans = 0
mod = 10**9+7
l = 1
for i in range(N):
    l = lcm(l,A[i])
l %= mod

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

print(ans)

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

Fixed submission:
def gcd(a,b):
    while b:a,b=b,a%b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)

N = int(input())
A = tuple(map(int,input().split(" ")))
ans = 0
mod = 10**9+7
l = 1
for i in range(N):
    l = lcm(l,A[i])
l %= mod

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

print(ans)