Buggy python submission (verdict: Runtime Error):
mod = 10**9 + 7
n = int(input())
lst = list(map(int, input().split()))
koubai = lst[0]
def gcd(a, b):
    if a > b:
        a, b = b, a
    while b > 0:
        a, b = b, a % b
    return a
for i in range(1, n):
    koubai = koubai*lst[i]//gcd(koubai, lst[i])
 
total = 0
for i in lst:
    total += koubai//l

print(total%mod)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
lcm = a[0]

def gcd(a, b):
    if a > b:
        a, b = b, a
    while b > 0:
        a, b = b, a % b
    return a

for i in range(1, n):
    lcm = lcm * a[i] // gcd(lcm, a[i])
mod = 10**9 + 7
ans = 0
for i in range(n):
    ans += lcm // a[i]
print(ans % mod)

Buggy python submission (verdict: Runtime Error):
mod = 10**9 + 7
n = int(input())
lst = list(map(int, input().split()))
koubai = lst[0]
def gcd(a, b):
    if a > b:
        a, b = b, a
    while b > 0:
        a, b = b, a % b
    return a
for i in range(1, n):
    koubai = koubai*lst[i]//gcd(koubai, lst[i])
 
total = 0
for l in lst:
    b += koubai//l

print(total%mod)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
lcm = a[0]

def gcd(a, b):
    if a > b:
        a, b = b, a
    while b > 0:
        a, b = b, a % b
    return a

for i in range(1, n):
    lcm = lcm * a[i] // gcd(lcm, a[i])
mod = 10**9 + 7
ans = 0
for i in range(n):
    ans += lcm // a[i]
print(ans % mod)

Buggy python submission (verdict: Time Limit Exceeded):
import fractions
mod = 10**9 + 7
n = int(input())
lst = list(map(int, input().split()))
koubai = lst[0]
def gcd(a, b):
    if a > b:
        a, b = b, a
    while b > 0:
        a, b = b, a % b
    return a
for i in range(1, n):
    koubai = koubai*lst[i]//gcd(koubai, lst[i])
 
total = 0
for l in lst:
    b = koubai//l
    total += b
    total %= mod
print(total)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
lcm = a[0]

def gcd(a, b):
    if a > b:
        a, b = b, a
    while b > 0:
        a, b = b, a % b
    return a

for i in range(1, n):
    lcm = lcm * a[i] // gcd(lcm, a[i])
mod = 10**9 + 7
ans = 0
for i in range(n):
    ans += lcm // a[i]
print(ans % mod)

Buggy python submission (verdict: Time Limit Exceeded):
import fractions
mod = 10**9 + 7
n = int(input())
lst = list(map(int, input().split()))
koubai = lst[0]
for i in range(1, n):
    koubai = koubai*lst[i]//fractions.gcd(koubai, lst[i])
 
total = 0
for l in lst:
    b = koubai//l
    total += b
    total %= mod
print(total)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
lcm = a[0]

def gcd(a, b):
    if a > b:
        a, b = b, a
    while b > 0:
        a, b = b, a % b
    return a

for i in range(1, n):
    lcm = lcm * a[i] // gcd(lcm, a[i])
mod = 10**9 + 7
ans = 0
for i in range(n):
    ans += lcm // a[i]
print(ans % mod)

Buggy python submission (verdict: Time Limit Exceeded):
import fractions
from functools import reduce
import numpy as np
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
mod = 10**9 + 7
n = int(input())
lst = list(map(int, input().split()))

koubai = lcm_list(lst)
tmp = np.array([koubai for _ in range(n)])
tmp2 = tmp//lst
print(tmp2.sum() % mod)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
lcm = a[0]

def gcd(a, b):
    if a > b:
        a, b = b, a
    while b > 0:
        a, b = b, a % b
    return a

for i in range(1, n):
    lcm = lcm * a[i] // gcd(lcm, a[i])
mod = 10**9 + 7
ans = 0
for i in range(n):
    ans += lcm // a[i]
print(ans % mod)

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

total = 0
for l in lst:
    b = koubai//l
    total += b
    total %= mod
print(total)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
lcm = a[0]

def gcd(a, b):
    if a > b:
        a, b = b, a
    while b > 0:
        a, b = b, a % b
    return a

for i in range(1, n):
    lcm = lcm * a[i] // gcd(lcm, a[i])
mod = 10**9 + 7
ans = 0
for i in range(n):
    ans += lcm // a[i]
print(ans % mod)

Buggy python submission (verdict: Time Limit Exceeded):
import fractions
from functools import reduce
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
mod = 10**9 + 7
n = int(input())
lst = list(map(int, input().split()))

koubai = lcm_list(lst)
total = 0
for l in lst:
    b = koubai//l
    total += b
    total %= mod
print(total)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
lcm = a[0]

def gcd(a, b):
    if a > b:
        a, b = b, a
    while b > 0:
        a, b = b, a % b
    return a

for i in range(1, n):
    lcm = lcm * a[i] // gcd(lcm, a[i])
mod = 10**9 + 7
ans = 0
for i in range(n):
    ans += lcm // a[i]
print(ans % mod)

Buggy python submission (verdict: Time Limit Exceeded):
import fractions
from functools import reduce
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
mod = 10**9 + 7
n = int(input())
lst = list(map(int, input().split()))

koubai = lcm_list(lst)
total = 0
for l in lst:
    b = koubai//l
    total += b
    total %= mod
print(total)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
lcm = a[0]

def gcd(a, b):
    if a > b:
        a, b = b, a
    while b > 0:
        a, b = b, a % b
    return a

for i in range(1, n):
    lcm = lcm * a[i] // gcd(lcm, a[i])
mod = 10**9 + 7
ans = 0
for i in range(n):
    ans += lcm // a[i]
print(ans % mod)