Problem p02793 (python)

Fixed submission:
import fractions
N = int(input())
A = list(map(int, input().split()))
AB = 1
for i in A:
    AB = AB*i//fractions.gcd(AB,i)
sumB = 0
for i in A:
    sumB += AB//i
print(int(sumB%(10**9+7)))

Buggy submission (verdict: Runtime Error):
import fractions
N = int(input())
A = list(map(int, input().split()))
AB = 1
for i in A:
    AB = AB*i//fractions.gcd(AB,i)
sumB = 0
for i in A:
    sumB += AB/i
print(int(sumB%(10**9+7)))

Buggy submission (verdict: Runtime Error):
import fractions
N = int(input())
A = list(map(int, input().split()))
AB = 1
for i in A:
    AB = AB*i//fractions.gcd(AB,i)
sumB = 0
for i in A:
    sumB += int(AB/i)
print(sumB%(10**9+7))

Buggy submission (verdict: Runtime Error):
import fractions
N = int(input())
A = list(map(int, input().split()))
AB = 1
for i in A:
    AB = (AB*i)//fractions.gcd(AB,i)
sumB = 0
for i in A:
    sumB += int(AB/i)
print(sumB%(10**9+7))

Buggy submission (verdict: Runtime Error):
import fractions
N = int(input())
A = list(map(int, input().split()))
AB = 1
for i in A:
    AB = (AB*i)//fractions.gcd(AB,i)
sumB = 0
for ii in range(N):
    sumB += int(AB/A[ii])
print(sumB%(10**9+7))

Buggy submission (verdict: Runtime Error):
import fractions
from functools import reduce
N = int(input())
A = list(map(int, input().split()))
def func(x,y):
    return (x*y)//fractions.gcd(x,y)
AB = reduce(func, A, 1)
sumB = 0
for ii in range(N):
    sumB += AB/A[ii]
print(int(sumB%(10**9+7)))

Buggy submission (verdict: Runtime Error):
import fractions
from functools import reduce
N = int(input())
A = list(map(int, input().split()))
def func(x,y):
    return (x*y)//fractions.gcd(x,y)
AB = reduce(func, A, 1)
sumB = 0
for ii in range(N):
    sumB += AB/A[ii]
print(sumB%(10**9+7))

Buggy submission (verdict: Runtime Error):
import fractions
from functools import reduce
N = int(input())
A = list(map(int, input().split()))
def func(x,y):
    return (x*y)//fractions.gcd(x,y)
AB = reduce(func, A, 1)
sumB = 0
for ii in range(N):
    sumB += AB/A[ii]
print(sumB%(10**9+7))

Buggy submission (verdict: Runtime Error):
import fractions
N = int(input())
A = list(map(int, input().split()))
AB = 1
for i in A:
    AB = (AB*i)//fractions.gcd(AB,i)
sumB = 0
for ii in range(N):
    sumB += int(AB/A[ii])%(10**9+7)
print(int(sumB%(10**9+7)))

Buggy submission (verdict: Runtime Error):
import fractions
from functools import reduce
N = int(input())
A = list(map(int, input().split()))
def func(x,y):
    return (x*y)//fractions.gcd(x,y)
AB = reduce(func, A, 1)
sumB = 0
for ii in range(N):
    sumB += int(AB/A[ii])%(10**9+7)
print(int(sumB%(10**9+7)))

Buggy submission (verdict: Runtime Error):
import fractions
from functools import reduce
N = int(input())
A = list(map(int, input().split()))
def func(x,y):
    return (x*y)//fractions.gcd(x,y)
AB = reduce(func, A, 1)
sumB = 0
for ii in range(N):
    sumB += (AB/A[ii])%(10**9+7)
print(int(sumB%(10**9+7)))

Buggy submission (verdict: Runtime Error):
import fractions
from functools import reduce
N = int(input())
A = list(map(int, input().split()))
def func(x,y):
    return (x*y)//fractions.gcd(x,y)
AB = reduce(func, A, 1)
sum = 0
for ii in range(N):
    sum += AB/A[ii]%(10**9+7)
print(int(sum%(10**9+7)))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
N = int(input())
A = list(map(int, input().split()))
def func(x,y):
    return (x*y)//math.gcd(x,y)
AB = reduce(func, A, 1)
sum = 0
for ii in range(N):
    sum += AB/A[ii]%(10**9+7)
print(int(sum%(10**9+7)))