Buggy python submission (verdict: Runtime Error):
# C
from functools import reduce

def lcm(a, b):
    return int(a*b/gcd(a, b))
def gcd(a,b):
    if a<b:a,b=b,a
    if a%b==0:return b
    return gcd(b,a%b)

n = int(input()) 
a = list(map(int, input().split()))

result = 0
mod = int(reduce(lcm, a))-1

for i in range(len(a)):
    result += mod % a[i] 

print(result)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))

print(sum(a) - n)

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

@lru_cache(None)
def lcm(a, b):
    return int(a*b/gcd(a, b))

n = int(input()) 
a = list(map(int, input().split()))

result = 0
mod = int(reduce(lcm, a))-1

for i in range(len(a)):
    result += mod % a[i] 

print(result)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))

print(sum(a) - n)

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

@lru_cache(None)
def lcm(a, b):
    return int(a*b/gcd(a, b))

n = int(input()) 
a = list(map(int, input().split()))

result = 0
mod = reduce(lcm, a)-1

for i in range(len(a)):
    result += mod % a[i] 

print(int(result))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))

print(sum(a) - n)

Buggy python submission (verdict: Runtime Error):
# C
from functools import reduce
from functools import lru_cache
import math

@lru_cache(None)
def lcm(a, b):
    return int(a*b/math.gcd(a, b))

n = int(input()) 
a = list(map(int, input().split()))

result = 0
mod = reduce(lcm, a)-1

for i in range(len(a)):
    result += mod % a[i] 

print(int(result))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))

print(sum(a) - n)

Buggy python submission (verdict: Runtime Error):
# C
from functools import reduce
import math

def lcm(a, b):
    return int(a*b/math.gcd(a, b))

n = int(input()) 
a = list(map(int, input().split()))

result = 0
mod = reduce(lcm, a)-1

for i in range(len(a)):
    result += mod % a[i] 

print(int(result))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))

print(sum(a) - n)

Buggy python submission (verdict: Runtime Error):
import math
import functools


n = int(input()) 
a = list(map(int, input().split()))

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

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

def lcm_list(numbers):
    return functools.reduce(lcm_base, numbers, 1)
result = 0
mod = lcm_list(a)-1

for i in range(len(a)):
    result += mod % a[i] 

print(result)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))

print(sum(a) - n)

Buggy python submission (verdict: Runtime Error):
# C

import math
from functools import reduce


n = int(input()) 
a = list(map(int, input().split()))

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)
result = 0
mod = lcm_list(a)-1

for i in range(len(a)):
    result += mod % a[i] 

print(result)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))

print(sum(a) - n)