Buggy python submission (verdict: Time Limit Exceeded):
#

import sys
input=sys.stdin.readline

MOD=10**9+7
kl = [0]*(10**6+1)

            
def main():
    N=int(input())
    A=list(map(int,input().split()))
    if N==1:
        print(1)
        exit()
    for j in range(N):
        n=A[j]
        for i in range(2,int((n)**0.5)+1):
            if n%i==0:
                cnt=0
                while(n%i==0):
                    n//=i
                    cnt+=1
                if kl[i]<cnt:
                    kl[i]=cnt
        if n!=1:
            if kl[n]<1:
                kl[n]=1
                
    lcm=1
    for i in range(2,10**6+1):
        lcm*=pow(i, kl[i], MOD)

    modsum=0
    for i in range(N):
        modsum+=pow(A[i],MOD-2,MOD)

    ans = lcm*modsum%MOD
    print(ans)
    
    
    
if __name__=="__main__":
    main()


Fixed submission:
#

import sys
input=sys.stdin.readline

MOD=10**9+7
kl = [0]*(10**6+1)

            
def main():
    N=int(input())
    A=list(map(int,input().split()))
    if N==1:
        print(1)
        exit()
    for j in range(N):
        n=A[j]
        for i in range(2,int((n)**0.5)+1):
            if n%i==0:
                cnt=0
                while(n%i==0):
                    n//=i
                    cnt+=1
                if kl[i]<cnt:
                    kl[i]=cnt
        if n!=1:
            if kl[n]<1:
                kl[n]=1
                
    lcm=1
    for i in range(2,10**6+1):
        lcm*=pow(i, kl[i], MOD)

    modsum=0
    for i in range(N):
        modsum+=pow(A[i],MOD-2,MOD)

    ans = lcm*modsum%MOD
    print(ans)
    
    
    
if __name__=="__main__":
    main()

Buggy python submission (verdict: Runtime Error):
#

import sys
input=sys.stdin.readline

MOD=10**9+7
kl = [0]*(10**6+1)

            
def main():
    N=int(input())
    A=list(map(int,input().split()))
    if N==1:
        print(1)
        exit()
    for j in range(N):
        n=A[j]
        for i in range(2,int((n)**0.5)+1):
            if n%i==0:
                cnt=0
                while(n%i==0):
                    n/=i
                    cnt+=1
                if kl[i]<cnt:
                    kl[i]=cnt
        if n!=1:
            if kl[n]<1:
                kl[n]=1
                
    lcm=1
    for i in range(2,10**6+1):
        lcm*=pow(i, kl[i], MOD)

    modsum=0
    for i in range(N):
        modsum+=pow(A[i],MOD-2,MOD)

    ans = lcm*modsum%MOD
    print(ans)
    
    
    
if __name__=="__main__":
    main()


Fixed submission:
#

import sys
input=sys.stdin.readline

MOD=10**9+7
kl = [0]*(10**6+1)

            
def main():
    N=int(input())
    A=list(map(int,input().split()))
    if N==1:
        print(1)
        exit()
    for j in range(N):
        n=A[j]
        for i in range(2,int((n)**0.5)+1):
            if n%i==0:
                cnt=0
                while(n%i==0):
                    n//=i
                    cnt+=1
                if kl[i]<cnt:
                    kl[i]=cnt
        if n!=1:
            if kl[n]<1:
                kl[n]=1
                
    lcm=1
    for i in range(2,10**6+1):
        lcm*=pow(i, kl[i], MOD)

    modsum=0
    for i in range(N):
        modsum+=pow(A[i],MOD-2,MOD)

    ans = lcm*modsum%MOD
    print(ans)
    
    
    
if __name__=="__main__":
    main()

Buggy python submission (verdict: Runtime Error):
#

import sys
input=sys.stdin.readline

MOD=10**9+7
            
def main():
    N=int(input())
    A=list(map(int,input().split()))
    if N==1:
        print(1)
        exit()
    kl=[0]*(10**6+1)
    for j in range(N):
        n=A[j]
        for i in range(2,int((n)**0.5)+1):
            if n%i==0:
                cnt=0
                while(n%i==0):
                    n/=i
                    cnt+=1
                if kl[i]<cnt:
                    kl[i]=cnt
        if n!=1:
            if kl[n]<1:
                kl[n]=1
                
    lcm=1
    for i in range(2,10**6+1):
        lcm*=pow(i, kl[i], MOD)
    ans=0
    for i in range(N):
        ans+=pow(A[i],MOD-2,MOD)
        ans%=MOD
    print(lcm*ans%MOD)
    
    
    
if __name__=="__main__":
    main()


Fixed submission:
#

import sys
input=sys.stdin.readline

MOD=10**9+7
kl = [0]*(10**6+1)

            
def main():
    N=int(input())
    A=list(map(int,input().split()))
    if N==1:
        print(1)
        exit()
    for j in range(N):
        n=A[j]
        for i in range(2,int((n)**0.5)+1):
            if n%i==0:
                cnt=0
                while(n%i==0):
                    n//=i
                    cnt+=1
                if kl[i]<cnt:
                    kl[i]=cnt
        if n!=1:
            if kl[n]<1:
                kl[n]=1
                
    lcm=1
    for i in range(2,10**6+1):
        lcm*=pow(i, kl[i], MOD)

    modsum=0
    for i in range(N):
        modsum+=pow(A[i],MOD-2,MOD)

    ans = lcm*modsum%MOD
    print(ans)
    
    
    
if __name__=="__main__":
    main()

Buggy python submission (verdict: Runtime Error):
import math
def LCM(a, b):
    return(a // math.gcd(a, b) * b)

n = int(input())
a = list(map(int, input().split()))
lc = 1;

for i in range(n):
    lc = LCM(lc, a[i])

res = 0;
for i in range(n):
    res = res + (lc // a[i])

print(res % 1000000007)



Fixed submission:
import fractions
def LCM(a, b):
    return(a // fractions.gcd(a, b) * b)

n = int(input())
a = list(map(int, input().split()))
lc = 1;

for i in range(n):
    lc = LCM(lc, a[i])

res = 0;
for i in range(n):
    res = res + (lc // a[i])

print(res % 1000000007)

Buggy python submission (verdict: Runtime Error):
import numpy as np

n = int(input())
a = list(map(int, input().split()))
lcm = 1

lc = np.lcm.reduce(a)

res = 0
for i in range(n):
    res = res + lc // a[i]
    res = res % 1000000007

print(res)



Fixed submission:
import fractions
def LCM(a, b):
    return(a // fractions.gcd(a, b) * b)

n = int(input())
a = list(map(int, input().split()))
lc = 1;

for i in range(n):
    lc = LCM(lc, a[i])

res = 0;
for i in range(n):
    res = res + (lc // a[i])

print(res % 1000000007)

Buggy python submission (verdict: Runtime Error):
import numpy as np

n = int(input())
a = list(map(int, input().split()))
lcm = 1

lc = mp.lcm.reduce(a)

res = 0
for i in range(n):
    res = res + lc // a[i]
    res = res % 1000000007

print(res)



Fixed submission:
import fractions
def LCM(a, b):
    return(a // fractions.gcd(a, b) * b)

n = int(input())
a = list(map(int, input().split()))
lc = 1;

for i in range(n):
    lc = LCM(lc, a[i])

res = 0;
for i in range(n):
    res = res + (lc // a[i])

print(res % 1000000007)

Buggy python submission (verdict: Runtime Error):
import numpy as np

n = int(input())
a = list(map(int, input().split()))
lcm = 1

lc = mp.lcm.reduce(a)

res = 0
for i in range(n):
    res = res + lc / a[i]
    res = res % 1000000007

print(res)



Fixed submission:
import fractions
def LCM(a, b):
    return(a // fractions.gcd(a, b) * b)

n = int(input())
a = list(map(int, input().split()))
lc = 1;

for i in range(n):
    lc = LCM(lc, a[i])

res = 0;
for i in range(n):
    res = res + (lc // a[i])

print(res % 1000000007)

Buggy python submission (verdict: Runtime Error):
import numpy as np

n = int(input())
a = []
lcm = 1
for i in range(n - 1):
    t = int(input())
    a.append(t)

lc = mp.lcm.reduce(a)

res = 0
for i in range(n - 1):
    res = res + lc / a[i]
    res = res % 1000000007

print(res)



Fixed submission:
import fractions
def LCM(a, b):
    return(a // fractions.gcd(a, b) * b)

n = int(input())
a = list(map(int, input().split()))
lc = 1;

for i in range(n):
    lc = LCM(lc, a[i])

res = 0;
for i in range(n):
    res = res + (lc // a[i])

print(res % 1000000007)

Buggy python submission (verdict: Runtime Error):
import numpy as np
     
n = int(input())
a = []
lcm = 1
for i in range(n - 1):
  t = int(input())
  a.append(t)
      
lc = np.lcm.reduce(a)
     
res = 0;
for i in range(n):
  res = res + lc / a[i];
  res = res % 1000000007
     
print(res)

Fixed submission:
import fractions
def LCM(a, b):
    return(a // fractions.gcd(a, b) * b)

n = int(input())
a = list(map(int, input().split()))
lc = 1;

for i in range(n):
    lc = LCM(lc, a[i])

res = 0;
for i in range(n):
    res = res + (lc // a[i])

print(res % 1000000007)

Buggy python submission (verdict: Runtime Error):
import numpy as np

n = int(input())
a = []
lcm = 1
for i in range(n):
  t = int(input())
  a.append(t)
  
lc = np.lcm.reduce(a)

res = 0;
for i in range(n):
  res = res + lc / a[i];
  res = res % 1000000007

print(res)


Fixed submission:
import fractions
def LCM(a, b):
    return(a // fractions.gcd(a, b) * b)

n = int(input())
a = list(map(int, input().split()))
lc = 1;

for i in range(n):
    lc = LCM(lc, a[i])

res = 0;
for i in range(n):
    res = res + (lc // a[i])

print(res % 1000000007)