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


def lcm_list(numbers):
    ans = numbers[0]
    for number in numbers[1:]:
        ans = (((number * ans)) //(fractions.gcd(number, ans)))
    return ans


MOD = 10 ** 9 + 7
N = input()
i = 0
arrs = list(map(int, input().split()))
lcms = lcm_list(arrs)
result = 0
for arr in arrs:
    result = (result + (lcms // arr)) % MOD
print(result)

Fixed submission:

from fractions import gcd
MOD = 10**9+7
N = input()
i = 0
arrs = list(map(int, input().split()))
result = 0
lcms = 1
for number in arrs:
    lcms = (((number * lcms)) //(gcd(number, lcms)))
for arr in arrs:
    result += (lcms//arr)
result = result%MOD
ans = str(result).replace('.0','')
print(ans)

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


MOD = 10**9+7
N = input()
i = 0
arrs = list(map(int, input().split()))
result = 0
lcms =1
for number in arrs:
    lcms = (((number * lcms)) / (fractions.gcd(number, lcms)))
for arr in arrs:
    result += (lcms/arr)
result = result%MOD
ans = str(result).replace('.0','')
print(ans)

Fixed submission:

from fractions import gcd
MOD = 10**9+7
N = input()
i = 0
arrs = list(map(int, input().split()))
result = 0
lcms = 1
for number in arrs:
    lcms = (((number * lcms)) //(gcd(number, lcms)))
for arr in arrs:
    result += (lcms//arr)
result = result%MOD
ans = str(result).replace('.0','')
print(ans)

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

def lcm_list(numbers):
    ans = numbers[0]
    for number in numbers[1:]:
        ans = (((number * ans)) / (fractions.gcd(number, ans)))
    return ans

MOD = 10**9+7
N = input()
i = 0
arrs = list(map(int, input().split()))
lcms = lcm_list(arrs)
result = 0
for arr in arrs:
    result += (lcms/arr)
result = result%MOD
ans = str(result).replace('.0','')
print(ans)

Fixed submission:

from fractions import gcd
MOD = 10**9+7
N = input()
i = 0
arrs = list(map(int, input().split()))
result = 0
lcms = 1
for number in arrs:
    lcms = (((number * lcms)) //(gcd(number, lcms)))
for arr in arrs:
    result += (lcms//arr)
result = result%MOD
ans = str(result).replace('.0','')
print(ans)

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):
    ans = numbers[0]
    for number in numbers[1:]:
        ans = (((number * ans)) / (fractions.gcd(number, ans)))
    return ans

MOD = 10**9+7
N = input()
i = 0
arrs = list(map(int, input().split()))
lcms = lcm_list(arrs)
result = 0
for arr in arrs:
    result = (result+lcms/arr)
result = result%MOD
print(round(result))

Fixed submission:

from fractions import gcd
MOD = 10**9+7
N = input()
i = 0
arrs = list(map(int, input().split()))
result = 0
lcms = 1
for number in arrs:
    lcms = (((number * lcms)) //(gcd(number, lcms)))
for arr in arrs:
    result += (lcms//arr)
result = result%MOD
ans = str(result).replace('.0','')
print(ans)

Buggy python submission (verdict: Runtime Error):
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)

MOD = 1e9+7
N = input()
i = 0
arrs = list(map(int, input().split()))
lcms = lcm_list(arrs)
result = 0
for arr in arrs:
    result = (result+lcms/arr)

print(int(result%MOD))

Fixed submission:

from fractions import gcd
MOD = 10**9+7
N = input()
i = 0
arrs = list(map(int, input().split()))
result = 0
lcms = 1
for number in arrs:
    lcms = (((number * lcms)) //(gcd(number, lcms)))
for arr in arrs:
    result += (lcms//arr)
result = result%MOD
ans = str(result).replace('.0','')
print(ans)

Buggy python submission (verdict: Runtime Error):
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)

MOD = 1e9+7
N = input()
i = 0
arrs = list(map(int, input().split()))
lcms = lcm_list(arrs)
result = 0
for arr in arrs:
    result = (result+lcms/arr) % MOD

print(int(result))

Fixed submission:

from fractions import gcd
MOD = 10**9+7
N = input()
i = 0
arrs = list(map(int, input().split()))
result = 0
lcms = 1
for number in arrs:
    lcms = (((number * lcms)) //(gcd(number, lcms)))
for arr in arrs:
    result += (lcms//arr)
result = result%MOD
ans = str(result).replace('.0','')
print(ans)

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)

MOD = 1e9+7
N = input()
i = 0
arrs = list(map(int, input().split()))
lcms = lcm_list(arrs)
result = 0
for arr in arrs:
    result = (result+lcms/arr) % MOD

print(int(result))

Fixed submission:

from fractions import gcd
MOD = 10**9+7
N = input()
i = 0
arrs = list(map(int, input().split()))
result = 0
lcms = 1
for number in arrs:
    lcms = (((number * lcms)) //(gcd(number, lcms)))
for arr in arrs:
    result += (lcms//arr)
result = result%MOD
ans = str(result).replace('.0','')
print(ans)