Buggy python submission (verdict: Runtime Error):
def main():
    import fractions
    n = int(input())
    array = list(map(int, input().split()))
    lcm = array[0]
    for i in range(1, n):
        lcm = lcm * array[i] // fractions.gcd(lcm, array[i])

    total = 0
    for i,num in enumerate(array):
        total += lcm / num
    print(int(total%(10**9+7)))

if __name__ == '__main__':
    main()

Fixed submission:
def main():
    import fractions
    n = int(input())
    array = list(map(int, input().split()))
    lcm = array[0]
    for i in range(1, n):
        lcm = lcm * array[i] // fractions.gcd(lcm, array[i])

    total = 0
    for i,num in enumerate(array):
        total += lcm // num
    print(int(total%(10**9+7)))

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
#２つでの再酥油公倍数
def lcm_base(x, y):
    from fractions import gcd
    return (x * y) // gcd(x, y)

def lcm_list(numbers):
    from functools import reduce
    return reduce(lcm_base, numbers, 1)


def main():
    n = int(input())
    array = list(map(int, input().split()))
    lcm = lcm_list(array)

    total = 0
    for i,num in enumerate(array):
        total += lcm / num
    print(int(total%(10**9+7)))

if __name__ == '__main__':
    main()

Fixed submission:
def main():
    import fractions
    n = int(input())
    array = list(map(int, input().split()))
    lcm = array[0]
    for i in range(1, n):
        lcm = lcm * array[i] // fractions.gcd(lcm, array[i])

    total = 0
    for i,num in enumerate(array):
        total += lcm // num
    print(int(total%(10**9+7)))

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
from fractions import gcd # for python3.4 or lower
from functools import reduce
 
#２つでの再酥油公倍数
def lcm_base(x, y):
    return (x * y) // gcd(x, y)
 
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
 
 
def main():
    n = int(input())
    array = list(map(int, input().split()))
    lcm = lcm_list(array)
 
    total = 0
    for i,num in enumerate(array):
        total += lcm / num
    print(int(total%(10**9+7)))
 
if __name__ == '__main__':
    main()

Fixed submission:
def main():
    import fractions
    n = int(input())
    array = list(map(int, input().split()))
    lcm = array[0]
    for i in range(1, n):
        lcm = lcm * array[i] // fractions.gcd(lcm, array[i])

    total = 0
    for i,num in enumerate(array):
        total += lcm // num
    print(int(total%(10**9+7)))

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
#２つでの再酥油公倍数
def lcm_base(x, y):
    import math
    return (x * y) // math.gcd(x, y)

def lcm_list(numbers):
    from functools import reduce
    return reduce(lcm_base, numbers, 1)


def main():
    n = int(input())
    array = list(map(int, input().split()))
    lcm = lcm_list(array)

    total = 0
    for i,num in enumerate(array):
        total += lcm / num
    print(int(total%(10**9+7)))

if __name__ == '__main__':
    main()

Fixed submission:
def main():
    import fractions
    n = int(input())
    array = list(map(int, input().split()))
    lcm = array[0]
    for i in range(1, n):
        lcm = lcm * array[i] // fractions.gcd(lcm, array[i])

    total = 0
    for i,num in enumerate(array):
        total += lcm // num
    print(int(total%(10**9+7)))

if __name__ == '__main__':
    main()

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


def main():
    n = int(input())
    array = list(map(int, input().split()))
    lcm = lcm_list(array)

    total = 0
    for i,num in enumerate(array):
        total += lcm / num
    print(int(total%(10**9+7)))

if __name__ == '__main__':
    main()

Fixed submission:
def main():
    import fractions
    n = int(input())
    array = list(map(int, input().split()))
    lcm = array[0]
    for i in range(1, n):
        lcm = lcm * array[i] // fractions.gcd(lcm, array[i])

    total = 0
    for i,num in enumerate(array):
        total += lcm // num
    print(int(total%(10**9+7)))

if __name__ == '__main__':
    main()