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(*numbers):
    return reduce(lcm_base, numbers, 1)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
N = int(input())
Alist = list(map(int, input().split()))
l = 1
ans = 0
for a in Alist:
    l = lcm(l, a)
for a in Alist:
    ans += l//a
print(ans%(10**9+7))


Fixed submission:
import sys
input = sys.stdin.readline
N = map(int, input().split())
Alist = list(map(int, input().split()))
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)


lcm_a = lcm_list(Alist)
mod = 10**9 + 7
ans = 0

for a in Alist:
    ans += (lcm_a // a)
print(ans % mod)

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(*numbers):
    return reduce(lcm_base, numbers, 1)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
N = int(input())
Alist = list(map(int, input().split()))
l = 1
ans = 0
for a in Alist:
    l = lcm(l, a)
for a in Alist:
    ans += l//a
print(ans%(10**9+7))


Fixed submission:
import sys
input = sys.stdin.readline
N = map(int, input().split())
Alist = list(map(int, input().split()))
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)


lcm_a = lcm_list(Alist)
mod = 10**9 + 7
ans = 0

for a in Alist:
    ans += (lcm_a // a)
print(ans % mod)

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(*numbers):
    return reduce(lcm_base, numbers, 1)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
N = int(input())
Alist = list(map(int, input().split()))
l = lcm_list(Alist)
ans = 0
for a in Alist:
    ans += l//a
print(ans%(10**9+7))


Fixed submission:
import sys
input = sys.stdin.readline
N = map(int, input().split())
Alist = list(map(int, input().split()))
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)


lcm_a = lcm_list(Alist)
mod = 10**9 + 7
ans = 0

for a in Alist:
    ans += (lcm_a // a)
print(ans % mod)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
N = map(int, input().split())
Alist = list(map(int, input().split()))
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)


lcm_a = lcm_list(Alist)
mod = 10**9 + 7
ans = 0

for a in Alist:
    ans += (lcm_a // a)
    ans %= mod
print(ans % mod)


Fixed submission:
import sys
input = sys.stdin.readline
N = map(int, input().split())
Alist = list(map(int, input().split()))
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)


lcm_a = lcm_list(Alist)
mod = 10**9 + 7
ans = 0

for a in Alist:
    ans += (lcm_a // a)
print(ans % mod)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
N = map(int, input().split())
Alist = list(map(int, input().split()))
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)


lcm_a = lcm_list(Alist)
mod = 10**9 + 7
ans = 0

for a in Alist:
    ans += (lcm_a // a)
print(ans % mod)


Fixed submission:
import sys
input = sys.stdin.readline
N = map(int, input().split())
Alist = list(map(int, input().split()))
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)


lcm_a = lcm_list(Alist)
mod = 10**9 + 7
ans = 0

for a in Alist:
    ans += (lcm_a // a)
print(ans % mod)

Buggy python submission (verdict: Time Limit Exceeded):
N = map(int, input().split())
Alist = list(map(int, input().split()))
import fractions
from functools import reduce


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


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


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


lcm_a = lcm_list(Alist)
mod = 10**9 + 7
ans = 0

for a in Alist:
    ans += (lcm_a // a)
    ans %= mod
print(ans)


Fixed submission:
import sys
input = sys.stdin.readline
N = map(int, input().split())
Alist = list(map(int, input().split()))
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)


lcm_a = lcm_list(Alist)
mod = 10**9 + 7
ans = 0

for a in Alist:
    ans += (lcm_a // a)
print(ans % mod)

Buggy python submission (verdict: Time Limit Exceeded):
N = map(int, input().split())
Alist = list(map(int, input().split()))
import fractions
from functools import reduce


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


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


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


lcm_a = lcm_list(Alist)
mod = 10**9 + 7
ans = 0

for a in Alist:
    ans += (lcm_a // a)
    ans %= mod
print(ans)


Fixed submission:
import sys
input = sys.stdin.readline
N = map(int, input().split())
Alist = list(map(int, input().split()))
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)


lcm_a = lcm_list(Alist)
mod = 10**9 + 7
ans = 0

for a in Alist:
    ans += (lcm_a // a)
print(ans % mod)