Buggy python submission (verdict: Time Limit Exceeded):
import math
import numpy as np
from fractions import gcd
import fractions
import statistics
import collections
from functools import reduce
import itertools
from collections import defaultdict
import bisect
from fractions import Fraction
 
 
N = int(input())
A=list(map(int, input().split()))
 
num = A[0]
for i in range(1, N):
    num = num * A[i] // fractions.gcd(num, A[i])
 
ans = 0
 
for i in range(N):
    ans += (num // A[i])
 
print(ans%(10**9+7))

Fixed submission:
import fractions as math
from functools import reduce
 
 
N = int(input())
A=list(map(int, input().split()))
 
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
 
num = lcm_list(A)
 
ans = 0
 
for i in range(N):
    ans += (num // A[i])
 
print(ans%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
import fractions as math
from functools import reduce
 
 
N = int(input())
A=list(map(int, input().split()))
 
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
 
num = lcm_list(A)
 
ans = 0
 
for i in range(N):
    ans += (num // A[i])
    ans %= 10**9+7
 
print(ans)

Fixed submission:
import fractions as math
from functools import reduce
 
 
N = int(input())
A=list(map(int, input().split()))
 
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
 
num = lcm_list(A)
 
ans = 0
 
for i in range(N):
    ans += (num // A[i])
 
print(ans%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
import math
import numpy as np
from fractions import gcd
import fractions as math
import statistics
import collections
from functools import reduce
import itertools
from collections import defaultdict
import bisect
from fractions import Fraction
 
 
N = int(input())
A=list(map(int, input().split()))
 
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
 
num = lcm_list(A)
 
ans = 0
 
for i in range(N):
    ans += (num // A[i])
    ans %= 10**9+7

print(ans)

Fixed submission:
import fractions as math
from functools import reduce
 
 
N = int(input())
A=list(map(int, input().split()))
 
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
 
num = lcm_list(A)
 
ans = 0
 
for i in range(N):
    ans += (num // A[i])
 
print(ans%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
import math
import numpy as np
from fractions import gcd
import fractions
import statistics
import collections
from functools import reduce
import itertools
from collections import defaultdict
import bisect
from fractions import Fraction
 
 
N = int(input())
A=list(map(int, input().split()))
 
num = A[0]
for i in range(1, N):
    num = num * A[i] // fractions.gcd(num%A[i], A[i])
 
ans = 0
 
for i in range(N):
    ans += (num // A[i])
    ans %= 10**9+7
 
print(ans)

Fixed submission:
import fractions as math
from functools import reduce
 
 
N = int(input())
A=list(map(int, input().split()))
 
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
 
num = lcm_list(A)
 
ans = 0
 
for i in range(N):
    ans += (num // A[i])
 
print(ans%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
import math
import numpy as np
from fractions import gcd
import fractions
import statistics
import collections
from functools import reduce
import itertools
from collections import defaultdict
import bisect
from fractions import Fraction


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

num = A[0]
for i in range(1, N):
    num = num * A[i] // fractions.gcd(num, A[i])

ans = 0

for i in range(N):
    ans += (num // A[i])
    ans %= 10**9+7

print(ans)

Fixed submission:
import fractions as math
from functools import reduce
 
 
N = int(input())
A=list(map(int, input().split()))
 
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
 
num = lcm_list(A)
 
ans = 0
 
for i in range(N):
    ans += (num // A[i])
 
print(ans%(10**9+7))

Buggy python submission (verdict: Runtime Error):
import math
import numpy as np
from fractions import gcd
import fractions
import statistics
import collections
from functools import reduce
import itertools
from collections import defaultdict
import bisect
from fractions import Fraction


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

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

num = lcm_list(A)

ans = 0

for i in range(N):
    ans += (num // A[i])
    ans %= 10**9+7

print(ans）

Fixed submission:
import fractions as math
from functools import reduce
 
 
N = int(input())
A=list(map(int, input().split()))
 
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
 
num = lcm_list(A)
 
ans = 0
 
for i in range(N):
    ans += (num // A[i])
 
print(ans%(10**9+7))