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

if True:
    N, *A = map(int, sys.stdin.read().split())
else:
    N = int(input())
    A = list(map(int, input().split()))

a = 1
for v in A:
    a = a * v // gcd(a, v)

MOD = int(1e9) + 7
sum_ = 0
for v in A:
    sum_ += a // v
    sum_ %= MOD

print(sum_)

Fixed submission:
from fractions import gcd
import sys

if True:
    N, *A = map(int, sys.stdin.read().split())
else:
    N = int(input())
    A = list(map(int, input().split()))

a = 1
for v in A:
    a = a * v // gcd(a, v)

MOD = int(1e9) + 7
sum_ = 0
for v in A:
    sum_ += a // v

print(sum_ % MOD)

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

if True:
    N, *A = map(int, sys.stdin.read().split())
else:
    N = int(input())
    A = list(map(int, input().split()))

a = 1
for v in A:
    a = a * v // gcd(a, v)

MOD = int(1e9) + 7
sum_ = 0
for v in A:
    sum_ += a // v
    sum_ %= MOD

print(sum_)

Fixed submission:
from fractions import gcd
import sys

if True:
    N, *A = map(int, sys.stdin.read().split())
else:
    N = int(input())
    A = list(map(int, input().split()))

a = 1
for v in A:
    a = a * v // gcd(a, v)

MOD = int(1e9) + 7
sum_ = 0
for v in A:
    sum_ += a // v

print(sum_ % MOD)

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

N = int(input())
A = list(map(int, input().split()))

a = 1
for i in range(N):
    a = a * A[i] // gcd(a, A[i])

MOD = int(1e9) + 7
sum_ = 0
for v in A:
    sum_ += a // v
    sum_ %= MOD

print(sum_)

Fixed submission:
from fractions import gcd
import sys

if True:
    N, *A = map(int, sys.stdin.read().split())
else:
    N = int(input())
    A = list(map(int, input().split()))

a = 1
for v in A:
    a = a * v // gcd(a, v)

MOD = int(1e9) + 7
sum_ = 0
for v in A:
    sum_ += a // v

print(sum_ % MOD)

Buggy python submission (verdict: Runtime Error):
import math

N = int(input())
A = list(map(int, input().split()))

def lcm_(a, b):
    return (a * b) // math.gcd(a, b)

lcm = A[0]
for a in A[1:]:
    lcm = lcm_(lcm, a)

MOD = int(1e9) + 7
sum_ = 0
for a in A:
    sum_ += lcm // a
    sum_ %= MOD

print(sum_)

Fixed submission:
from fractions import gcd
import sys

if True:
    N, *A = map(int, sys.stdin.read().split())
else:
    N = int(input())
    A = list(map(int, input().split()))

a = 1
for v in A:
    a = a * v // gcd(a, v)

MOD = int(1e9) + 7
sum_ = 0
for v in A:
    sum_ += a // v

print(sum_ % MOD)

Buggy python submission (verdict: Runtime Error):
import math

N = int(input())
A = list(map(int, input().split()))

def lcm_(a, b):
    return (a * b) // math.gcd(a, b)

lcm = A[0]
for a in A[1:]:
    lcm = lcm_(lcm, a)

MOD = int(1e9) + 7
sum_ = 0
for a in A:
    sum_ += lcm // a
    sum_ %= MOD

print(sum_)

Fixed submission:
from fractions import gcd
import sys

if True:
    N, *A = map(int, sys.stdin.read().split())
else:
    N = int(input())
    A = list(map(int, input().split()))

a = 1
for v in A:
    a = a * v // gcd(a, v)

MOD = int(1e9) + 7
sum_ = 0
for v in A:
    sum_ += a // v

print(sum_ % MOD)

Buggy python submission (verdict: Runtime Error):
import math

N = int(input())
A = list(map(int, input().split()))

def lcm_(a, b): return (a * b) // math.gcd(a, b)

lcm = A[0]
for a in A[1:]:
    lcm = lcm_(lcm, a)

MOD = int(1e9) + 7
sum_ = 0
for a in A:
    sum_ += lcm // a
    sum_ %= MOD

print(sum_)

Fixed submission:
from fractions import gcd
import sys

if True:
    N, *A = map(int, sys.stdin.read().split())
else:
    N = int(input())
    A = list(map(int, input().split()))

a = 1
for v in A:
    a = a * v // gcd(a, v)

MOD = int(1e9) + 7
sum_ = 0
for v in A:
    sum_ += a // v

print(sum_ % MOD)