Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import deque, Counter, defaultdict
from fractions import gcd
from math import *
input = sys.stdin.readline

def main():
    n = int(input())
    As = list(map(int, input().split()))
    mod = 10**9 + 7

    isp, fac_table = min_factor_table(max(As)+1)
    fac_table = fac_table[:-1]

    prime_factors = defaultdict(int)
    #各素因数の最大値を保持
    for i in range(n):
        pf = factorization(fac_table, As[i])
        for j in pf:
            prime_factors[j] = max(pf[j], prime_factors[j])
    
    lcm = 1
    for key in prime_factors:
        lcm *= pow(key, prime_factors[key])    
    
    ans = 0
    ans = sum([lcm // As[i] for i in range(n)]) % mod

    print(ans)
    return

def factorization(table, n):
    # O(log N )
    k = n
    prime_factors = defaultdict(int)
    while k != 1:
        if k % table[k] == 0:
            prime_factors[table[k]] += 1
            k //= table[k]

    return prime_factors


def min_factor_table(n):
    #多分計算量はO(N log N)
    is_prime = [True]*(n+1)
    is_prime[0] = False
    is_prime[1] = False
    min_factor = [None]*(n+1)
    min_factor[0] = 0
    min_factor[1] = 1
    cnt = 0
    # 計算する必要があるのは√n まで
    for i in range(2, n+1):   
        for j in range(2, ceil(n/i)):
            cnt += 1
            if min_factor[i*j] is None:
                min_factor[i*j] = i
            is_prime[i*j] = False
        if is_prime[i]:
            min_factor[i] = i
    return is_prime, min_factor


#参考: https://qiita.com/ophhdn/items/e6451ec5983939ecbc5b
def pow(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans



if __name__ == '__main__':
    main()

Fixed submission:
from functools import reduce
from fractions import gcd

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers)
mod = 10**9 + 7
n = int(input())
As = list(map(int, input().split()))

lcm = lcm_list(As)
b = [lcm//As[i] for i in range(n)]

print(sum(b) % mod)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import deque, Counter, defaultdict
from fractions import gcd
from math import *
input = sys.stdin.readline

def main():
    n = int(input())
    As = list(map(int, input().split()))
    mod = 10**9 + 7

    isp, fac_table = min_factor_table(max(As)+1)
    fac_table = fac_table[:-1]

    prime_factors = defaultdict(int)
    #各素因数の最大値を保持
    for i in range(n):
        pf = factorization(fac_table, As[i])
        for j in pf:
            prime_factors[j] = max(pf[j], prime_factors[j])
    
    lcm = 1
    for key in prime_factors:
        lcm *= pow(key, prime_factors[key])    
    
    ans = 0
    ans = sum([lcm // As[i] for i in range(n)]) % mod

    print(ans)
    return

def factorization(table, n):
    # O(log N )
    k = n
    prime_factors = defaultdict(int)
    while k != 1:
        if k % table[k] == 0:
            prime_factors[table[k]] += 1
            k //= table[k]

    return prime_factors


def min_factor_table(n):
    #多分計算量はO(N log N)
    is_prime = [True]*(n+1)
    is_prime[0] = False
    is_prime[1] = False
    min_factor = [None]*(n+1)
    min_factor[0] = 0
    min_factor[1] = 1
    cnt = 0
    # 計算する必要があるのは√n まで
    for i in range(2, n+1):   
        for j in range(2, ceil(n/i)):
            cnt += 1
            if min_factor[i*j] is None:
                min_factor[i*j] = i
            is_prime[i*j] = False
        if is_prime[i]:
            min_factor[i] = i
    return is_prime, min_factor


#参考: https://qiita.com/ophhdn/items/e6451ec5983939ecbc5b
def pow(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans



if __name__ == '__main__':
    main()

Fixed submission:
from functools import reduce
from fractions import gcd

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers)
mod = 10**9 + 7
n = int(input())
As = list(map(int, input().split()))

lcm = lcm_list(As)
b = [lcm//As[i] for i in range(n)]

print(sum(b) % mod)

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

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

def lcm_list(l):
    lcm = l[0]
    for i in range(len(l)):
        lcm = lcm*l[i] // gcd(lcm, l[i])
    return lcm

mod = 10**9 + 7
n = int(input())
As = list(map(int, input().split()))

lcm = lcm_list(As)
b = [lcm//As[i] for i in range(n)]

print(sum(b) % mod)


Fixed submission:
from functools import reduce
from fractions import gcd

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers)
mod = 10**9 + 7
n = int(input())
As = list(map(int, input().split()))

lcm = lcm_list(As)
b = [lcm//As[i] for i in range(n)]

print(sum(b) % mod)

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

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
mod = 10**9 + 7
n = int(input())
As = list(map(int, input().split()))

lcm = lcm_list(As)
b = [lcm//As[i] for i in range(n)]

print(sum(b) % mod)

Fixed submission:
from functools import reduce
from fractions import gcd

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers)
mod = 10**9 + 7
n = int(input())
As = list(map(int, input().split()))

lcm = lcm_list(As)
b = [lcm//As[i] for i in range(n)]

print(sum(b) % mod)

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

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
mod = 10**9 + 7
n = int(input())
As = list(map(int, input().split()))

lcm = lcm_list(As)

As = np.array(As)

print(np.sum(lcm//As) % mod)

Fixed submission:
from functools import reduce
from fractions import gcd

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers)
mod = 10**9 + 7
n = int(input())
As = list(map(int, input().split()))

lcm = lcm_list(As)
b = [lcm//As[i] for i in range(n)]

print(sum(b) % mod)

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

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
mod = 10**9 + 7
n = int(input())
As = list(map(int, input().split()))

lcm = lcm_list(As)

As = np.array(As)

print(np.sum(lcm//As) % mod)

Fixed submission:
from functools import reduce
from fractions import gcd

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers)
mod = 10**9 + 7
n = int(input())
As = list(map(int, input().split()))

lcm = lcm_list(As)
b = [lcm//As[i] for i in range(n)]

print(sum(b) % mod)

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

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
mod = 10**9 + 7
n = int(input())
As = list(map(int, input().split()))

lcm = lcm_list(As)

As = np.array(As)
lc = np.array([lcm]*n)

print(np.sum(lc//As) % mod)

Fixed submission:
from functools import reduce
from fractions import gcd

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers)
mod = 10**9 + 7
n = int(input())
As = list(map(int, input().split()))

lcm = lcm_list(As)
b = [lcm//As[i] for i in range(n)]

print(sum(b) % mod)

Buggy python submission (verdict: Runtime Error):
from functools import reduce
from fractions import gcd
import numpy as np

n = int(input())
As = list(map(int, input().split()))
mod = 10**9 + 7

def lcm_base(x, y):
    return (x * y) // gcd(x, y)
 
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
lcm = lcm_list(As)
As = np.array(As)
b = np.array([lcm]*n)
c = b / As
print(int(round(np.sum(c)))  % mod)


Fixed submission:
from functools import reduce
from fractions import gcd

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers)
mod = 10**9 + 7
n = int(input())
As = list(map(int, input().split()))

lcm = lcm_list(As)
b = [lcm//As[i] for i in range(n)]

print(sum(b) % mod)

Buggy python submission (verdict: Runtime Error):
from functools import reduce
from fractions import gcd
import numpy as np

n = int(input())
As = list(map(int, input().split()))
mod = 10**9 + 7

def lcm_base(x, y):
    return (x * y) // gcd(x, y)
 
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
lcm = lcm_list(As)
As = np.array(As)
b = np.array([lcm]*n)
c = b / As
print(int(round(np.sum(c) % mod)))


Fixed submission:
from functools import reduce
from fractions import gcd

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers)
mod = 10**9 + 7
n = int(input())
As = list(map(int, input().split()))

lcm = lcm_list(As)
b = [lcm//As[i] for i in range(n)]

print(sum(b) % mod)

Buggy python submission (verdict: Runtime Error):
from functools import reduce
from fractions import gcd
import numpy as np

n = int(input())
As = list(map(int, input().split()))
mod = 10**9 + 7

def lcm_base(x, y):
    return (x * y) // gcd(x, y)
 
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
lcm = lcm_list(As)
As = np.array(As)
b = np.array([lcm]*n)
c = b / As
print(int(np.sum(c) % mod))


Fixed submission:
from functools import reduce
from fractions import gcd

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers)
mod = 10**9 + 7
n = int(input())
As = list(map(int, input().split()))

lcm = lcm_list(As)
b = [lcm//As[i] for i in range(n)]

print(sum(b) % mod)

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

n = int(input())
As = list(map(int, input().split()))
As = np.array(As)
mod = 10**9 + 7



k = np.lcm.reduce(As)
ans = 0
for i in range(n):
    ans += k // As[i]
    ans %= mod
print(ans)


Fixed submission:
from functools import reduce
from fractions import gcd

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers)
mod = 10**9 + 7
n = int(input())
As = list(map(int, input().split()))

lcm = lcm_list(As)
b = [lcm//As[i] for i in range(n)]

print(sum(b) % mod)

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

n = int(input())
As = list(map(int, input().split()))
mod = 10**9 + 7
def lcm(l):
    if len(l) == 2:
        return l[1]*l[0] // gcd(l[1], l[0])
    else:
        k = lcm(l[:-1])
        return k*l[-1] // gcd(k, l[-1])

k = lcm(As)
ans = 0
for i in range(n):
    ans += k // As[i]
    ans %= mod
print(ans)

Fixed submission:
from functools import reduce
from fractions import gcd

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers)
mod = 10**9 + 7
n = int(input())
As = list(map(int, input().split()))

lcm = lcm_list(As)
b = [lcm//As[i] for i in range(n)]

print(sum(b) % mod)

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

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
mod = 10**9 + 7
n = int(input())
As = list(map(int, input().split()))

lcm = lcm_list(As)
ans = 0
for i in range(n):
    ans += lcm // As[i]
    ans %= mod

print(ans)

Fixed submission:
from functools import reduce
from fractions import gcd

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers)
mod = 10**9 + 7
n = int(input())
As = list(map(int, input().split()))

lcm = lcm_list(As)
b = [lcm//As[i] for i in range(n)]

print(sum(b) % mod)

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

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
mod = 10**9 + 7
n = int(input())
As = list(map(int, input().split()))

lcm = lcm_list(As)
ans = 0
for i in range(n):
    ans += lcm // As[i]
    ans %= mod

print(ans)

Fixed submission:
from functools import reduce
from fractions import gcd

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers)
mod = 10**9 + 7
n = int(input())
As = list(map(int, input().split()))

lcm = lcm_list(As)
b = [lcm//As[i] for i in range(n)]

print(sum(b) % mod)