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

Fixed submission:
from fractions import gcd
mod = pow(10, 9)+7
n = int(input())
A = list(map(int, input().split()))
m = A[0]
for i in range(1, n):
  m = m // gcd(m, A[i]) * A[i]
ans = 0
for i in A:
  ans += m//i
print(ans%mod)

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

Fixed submission:
from fractions import gcd
mod = pow(10, 9)+7
n = int(input())
A = list(map(int, input().split()))
m = A[0]
for i in range(1, n):
  m = m // gcd(m, A[i]) * A[i]
ans = 0
for i in A:
  ans += m//i
print(ans%mod)

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


Fixed submission:
from fractions import gcd
mod = pow(10, 9)+7
n = int(input())
A = list(map(int, input().split()))
m = A[0]
for i in range(1, n):
  m = m // gcd(m, A[i]) * A[i]
ans = 0
for i in A:
  ans += m//i
print(ans%mod)

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

Fixed submission:
from fractions import gcd
mod = pow(10, 9)+7
n = int(input())
A = list(map(int, input().split()))
m = A[0]
for i in range(1, n):
  m = m // gcd(m, A[i]) * A[i]
ans = 0
for i in A:
  ans += m//i
print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
mod = pow(10, 9)+7
def main():
  n = int(input())
  A = list(map(int, input().split()))
  m = A[0]
  for i in range(1, n):
    m = m // gcd(m, A[i]) * A[i]
  ans = 0
  for i in A:
    ans += m//i
  print(ans%mod)
if __name__ == "__main__":
  main()

Fixed submission:
from fractions import gcd
mod = pow(10, 9)+7
n = int(input())
A = list(map(int, input().split()))
m = A[0]
for i in range(1, n):
  m = m // gcd(m, A[i]) * A[i]
ans = 0
for i in A:
  ans += m//i
print(ans%mod)

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

Fixed submission:
from fractions import gcd
mod = pow(10, 9)+7
n = int(input())
A = list(map(int, input().split()))
m = A[0]
for i in range(1, n):
  m = m // gcd(m, A[i]) * A[i]
ans = 0
for i in A:
  ans += m//i
print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
mod = 10**9+7
def main():
  n = int(input())
  A = list(map(int, input().split()))
  m = A[0]
  for i in A[1:]:
    m = m // gcd(m, i) * i
  ans = 0
  for i in A:
    ans += m//i
  print(ans%mod)
if __name__ == "__main__":
  main()

Fixed submission:
from fractions import gcd
mod = pow(10, 9)+7
n = int(input())
A = list(map(int, input().split()))
m = A[0]
for i in range(1, n):
  m = m // gcd(m, A[i]) * A[i]
ans = 0
for i in A:
  ans += m//i
print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
mod = 10**9+7
def main():
  n = int(input())
  A = list(map(int, input().split()))
  cnt = 0
  m = A[0]
  for i in A[1:]:
    m = m // gcd(m, i) * i
  ans = 0
  for i in A:
    ans += m//i
    ans %= mod
  print(ans)
if __name__ == "__main__":
  main()

Fixed submission:
from fractions import gcd
mod = pow(10, 9)+7
n = int(input())
A = list(map(int, input().split()))
m = A[0]
for i in range(1, n):
  m = m // gcd(m, A[i]) * A[i]
ans = 0
for i in A:
  ans += m//i
print(ans%mod)

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

Fixed submission:
from fractions import gcd
mod = pow(10, 9)+7
n = int(input())
A = list(map(int, input().split()))
m = A[0]
for i in range(1, n):
  m = m // gcd(m, A[i]) * A[i]
ans = 0
for i in A:
  ans += m//i
print(ans%mod)

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

Fixed submission:
from fractions import gcd
mod = pow(10, 9)+7
n = int(input())
A = list(map(int, input().split()))
m = A[0]
for i in range(1, n):
  m = m // gcd(m, A[i]) * A[i]
ans = 0
for i in A:
  ans += m//i
print(ans%mod)

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

Fixed submission:
from fractions import gcd
mod = pow(10, 9)+7
n = int(input())
A = list(map(int, input().split()))
m = A[0]
for i in range(1, n):
  m = m // gcd(m, A[i]) * A[i]
ans = 0
for i in A:
  ans += m//i
print(ans%mod)