Buggy python submission (verdict: Time Limit Exceeded):
import fractions
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

N=int(input())
A=list(map(int,input().split()))
MOD=(10**9)+7
S=list(set(A))
LCM=lcm_list(S)
ans=0

for i in range(N):
    ans+=(LCM//A[i])
    ans=ans%MOD

print(ans)


Fixed submission:
import fractions
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

N=int(input())
A=list(map(int,input().split()))
MOD=(10**9)+7
S=list(set(A))
LCM=lcm_list(S)
ans=0

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


print(ans%MOD)

Buggy python submission (verdict: Runtime Error):
import fractions as math
from functools import reduce

def lcm(x, y):
    return (x * y) // math.gcd(x, y)


N=int(input())
A=list(map(int,input().split()))
MOD=(10**9)+7
S=list(set(A))
LCM=lcm(A[0],A[1])
for i in range(2,N):
    LCM=lcm(LCM,A[i])
    

ans=0

for i in range(N):
    ans+=(LCM//A[i])
    ans=ans%MOD

print(ans)

Fixed submission:
import fractions
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

N=int(input())
A=list(map(int,input().split()))
MOD=(10**9)+7
S=list(set(A))
LCM=lcm_list(S)
ans=0

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


print(ans%MOD)

Buggy python submission (verdict: Time Limit Exceeded):
import fractions as math
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

N=int(input())
A=list(map(int,input().split()))
MOD=(10**9)+7
S=list(set(A))
LCM=lcm_list(S)
ans=0

for i in range(N):
    ans+=(LCM//A[i])
    ans=ans%MOD

print(ans)

Fixed submission:
import fractions
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

N=int(input())
A=list(map(int,input().split()))
MOD=(10**9)+7
S=list(set(A))
LCM=lcm_list(S)
ans=0

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


print(ans%MOD)

Buggy python submission (verdict: Time Limit Exceeded):
import fractions as math
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

N=int(input())
A=list(map(int,input().split()))
MOD=(10**9)+7

LCM=lcm_list(A)
ans=0

for i in range(N):
    ans+=(LCM//A[i])
    ans=ans%MOD

print(ans)

Fixed submission:
import fractions
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

N=int(input())
A=list(map(int,input().split()))
MOD=(10**9)+7
S=list(set(A))
LCM=lcm_list(S)
ans=0

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


print(ans%MOD)

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

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

N=int(input())
A=list(map(int,input().split()))
MOD=(10**9)+7

LCM=lcm_list(A)
ans=0

for i in range(N):
    ans+=(LCM//A[i])
    ans=ans%MOD

print(ans)

Fixed submission:
import fractions
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

N=int(input())
A=list(map(int,input().split()))
MOD=(10**9)+7
S=list(set(A))
LCM=lcm_list(S)
ans=0

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


print(ans%MOD)