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

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

lcm_a = 1
 
for i in range(N):
    lcm_a = lcm(lcm_a,A[i])
 
ans = 0
for i in range(N):
    ans += lcm_a//A[i]

print(ans%(10**9+7))

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

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

def lcm(a, b):
    return (a * b)//gcd(a,b)

lcm_a = 1

for i in range(N):
    lcm_a = lcm(lcm_a,A[i])

ans = 0
for i in range(N):
    ans += lcm_a//A[i]

mod = int(1e9+7)

print(ans%mod)

Buggy python submission (verdict: Runtime Error):
from fractions import gcd

def lcm(a, b):
    return (a * b)//gcd(a,b)

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

lcm_a = 1

for i in range(N):
    lcm_a = lcm(lcm_a,A[i])

B = np.array([])
for i in range(N):
    B = np.append(B,lcm_a//A[i])

mod = int(1e9+7)
print(int((np.sum(B)%mod)))

from fractions import gcd

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

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

def lcm(a, b):
    return (a * b)//gcd(a,b)

lcm_a = 1

for i in range(N):
    lcm_a = lcm(lcm_a,A[i])

ans = 0
for i in range(N):
    ans += lcm_a//A[i]

mod = int(1e9+7)

print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
 
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a

def lcm(a, b):
    return (a * b)//gcd(a,b)

lcm_a = 1
 
for i in range(N):
    lcm_a = lcm(lcm_a,A[i])
    
ans = 0
mod = int(1e9+7)
for i in range(N):
    ans += (lcm_a//A[i])%mod
    
print(ans%mod)

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

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

def lcm(a, b):
    return (a * b)//gcd(a,b)

lcm_a = 1

for i in range(N):
    lcm_a = lcm(lcm_a,A[i])

ans = 0
for i in range(N):
    ans += lcm_a//A[i]

mod = int(1e9+7)

print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np 

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

def lcm(a, b):
    return (a * b)//gcd(a,b)

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

lcm_a = 1

for i in range(N):
    lcm_a = lcm(lcm_a,A[i])

B = np.array([])
for i in range(N):
    B = np.append(B,lcm_a//A[i])

mod = int(1e9+7)
print(int((np.sum(B)%mod)))

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

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

def lcm(a, b):
    return (a * b)//gcd(a,b)

lcm_a = 1

for i in range(N):
    lcm_a = lcm(lcm_a,A[i])

ans = 0
for i in range(N):
    ans += lcm_a//A[i]

mod = int(1e9+7)

print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))

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

def lcm(a, b):
    return (a * b)//gcd(a,b)

lcm_a = 1

for i in range(N):
    lcm_a = lcm(lcm_a,A[i])

B = []

for i in range(N):
    B.append(lcm_a//A[i])

mod = int(1e9+7)

print(sum(B)%mod)

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

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

def lcm(a, b):
    return (a * b)//gcd(a,b)

lcm_a = 1

for i in range(N):
    lcm_a = lcm(lcm_a,A[i])

ans = 0
for i in range(N):
    ans += lcm_a//A[i]

mod = int(1e9+7)

print(ans%mod)