Buggy python submission (verdict: Runtime Error):
from fractions import gcd
def lcm(x,y):
  return (x*y) // gcd(x,y)
n = int(input())
a = list(map(int,input().split()))
mod = 10**9+7
l = a[0]
for i in range(1,n):
  l = lcm(l,a[i])
for i in range(n):
  ans += l//a[i]
print(ans%mod)

Fixed submission:
from fractions import gcd
def lcm(x,y):
  return (x*y) // gcd(x,y)
n = int(input())
a = list(map(int,input().split()))
mod = 10**9+7
l = a[0]
for i in range(1,n):
  l = lcm(l,a[i])
ans = 0
for i in range(n):
  ans += l//a[i]
print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
def lcm(x,y):
  return (x*y) // gcd(x,y)
n = int(input())
a = list(map(int,input().split()))
mod = 10**9+7
l = a[0]
for i in range(1,n):
  l = lcm(l,a[i])
ans = 0
for i in range(n):
  ans += (l//a[i])%mod
print(ans%mod)

Fixed submission:
from fractions import gcd
def lcm(x,y):
  return (x*y) // gcd(x,y)
n = int(input())
a = list(map(int,input().split()))
mod = 10**9+7
l = a[0]
for i in range(1,n):
  l = lcm(l,a[i])
ans = 0
for i in range(n):
  ans += l//a[i]
print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
from fractions import gcd
n = int(input())
mod = 10**9+7
A = list(map(int,input().split()))
ans1 = 1
for i in range(n):
  ans1 *= A[i] // gcd(A[i], ans1)
ans = 0
for i in range(n):
  if A[i] > 0:
    ans += ans1 // A[i]
    ans %= mod
print(ans)

Fixed submission:
from fractions import gcd
def lcm(x,y):
  return (x*y) // gcd(x,y)
n = int(input())
a = list(map(int,input().split()))
mod = 10**9+7
l = a[0]
for i in range(1,n):
  l = lcm(l,a[i])
ans = 0
for i in range(n):
  ans += l//a[i]
print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
from fractions import gcd
n = int(input())
mod = 10**9+7
A = list(map(int,input().split()))
ans1 = 1
for i in range(n):
  ans1 *= A[i] // gcd(A[i], ans1)
ans = 0
for i in range(n):
  if A[i] > 0:
    ans += ans1 // A[i]
    ans %= mod
print(ans)

Fixed submission:
from fractions import gcd
def lcm(x,y):
  return (x*y) // gcd(x,y)
n = int(input())
a = list(map(int,input().split()))
mod = 10**9+7
l = a[0]
for i in range(1,n):
  l = lcm(l,a[i])
ans = 0
for i in range(n):
  ans += l//a[i]
print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
n = int(input())
mod = 10**9+7
A = list(map(int,input().split()))
B = max(A)
cnt = [0]*(B+1)
def f(x):
  a = []
  while x % 2 == 0:
    a.append(2)
    x //= 2
  f = 3
  while f * f <= x:
    if x % f == 0:
      a.append(f)
      x //= f
    else:
      f += 2
  if x != 1:
    a.append(x)
  return Counter(a).items()
for i in range(n):
  dct = f(A[i])
  for l in dct:
    if cnt[l[0]] < l[1]:
      cnt[l[0]] = l[1]
ans1 = 1
for i in range(B+1):
  ans1 *= (i**cnt[i])
ans = 0
for i in range(n):
  if A[i] > 0:
    ans += ans1 // A[i]
    ans %= mod
print(ans)

Fixed submission:
from fractions import gcd
def lcm(x,y):
  return (x*y) // gcd(x,y)
n = int(input())
a = list(map(int,input().split()))
mod = 10**9+7
l = a[0]
for i in range(1,n):
  l = lcm(l,a[i])
ans = 0
for i in range(n):
  ans += l//a[i]
print(ans%mod)

Buggy python submission (verdict: Runtime Error):
from fractions import gcd
def lcm(x,y):
  return (x*y) // gcd(x,y)
n = int(input())
a = list(map(int,input().split()))
mod = 10**9+7
l = a[0]
for i in range(1,n):
  l = lcm(l,a[i])
for i in range(n):
  ans += (l//a[i])%mod
print(ans%mod)

Fixed submission:
from fractions import gcd
def lcm(x,y):
  return (x*y) // gcd(x,y)
n = int(input())
a = list(map(int,input().split()))
mod = 10**9+7
l = a[0]
for i in range(1,n):
  l = lcm(l,a[i])
ans = 0
for i in range(n):
  ans += l//a[i]
print(ans%mod)