Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
MOD = 10**9 + 7
t = A[0]

def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)
def lcm(a,b):
    return a*b//gcd(a,b)
for e in A:
    t = lcm(e,t)

ans = 0
for e in A:
    ans += t//e
    ans %= MOD
print(ans)


Fixed submission:
N = int(input())
A = list(map(int,input().split()))
MOD = 10**9 + 7
t = A[0]

def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)
def lcm(a,b):
    return a*b//gcd(a,b)
for e in A:
    t = lcm(e,t)

ans = 0
for e in A:
    ans += t//e

print(ans%MOD)

Buggy python submission (verdict: Runtime Error):
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i = 0; i < (int)(n); ++i)
#define ALL(a)  (a).begin(),(a).end()
typedef long long ll;

inline ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

int main(){
    ll MOD = 1000000007;
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int N;
    cin >> N;
    vector<ll> A(N,0);
    REP(i,N){
        cin >> A[i];}
    ll c = A[0];
    for (auto e: A){
        c = lcm(e,c);
    }
    ll ans = 0;
    for (auto e: A){
        ans += c/e;
        ans %= MOD;
    }
    cout << ans << endl;
    return 0;
}


Fixed submission:
N = int(input())
A = list(map(int,input().split()))
MOD = 10**9 + 7
t = A[0]

def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)
def lcm(a,b):
    return a*b//gcd(a,b)
for e in A:
    t = lcm(e,t)

ans = 0
for e in A:
    ans += t//e

print(ans%MOD)

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
import sys, math

def input():
    return sys.stdin.readline()
def main():
    N = int(input())
    A = list(map(int,input().split()))
    MOD = 10**9 + 7
    t = A[0]
    def lcm(a,b):
        return a*b//gcd(a,b)
    for e in A:
        t = lcm(e,t)
    ans = 0
    for e in A:
        ans += t//e
        ans %= MOD
    print(ans)
if __name__ == '__main__':
    main()


Fixed submission:
N = int(input())
A = list(map(int,input().split()))
MOD = 10**9 + 7
t = A[0]

def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)
def lcm(a,b):
    return a*b//gcd(a,b)
for e in A:
    t = lcm(e,t)

ans = 0
for e in A:
    ans += t//e

print(ans%MOD)

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
import sys, math

def input():
    return sys.stdin.readline()
def main():
    N = int(input())
    A = list(map(int,input().split()))
    MOD = 10**9 + 7
    t = A[0]
    def lcm(a,b):
        return a*b//gcd(a,b)
    for e in A:
        t = lcm(e,t)
    ans = 0
    for e in A:
        ans += t//e
        ans %= MOD
    print(ans)
if __name__ == '__main__':
    main()


Fixed submission:
N = int(input())
A = list(map(int,input().split()))
MOD = 10**9 + 7
t = A[0]

def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)
def lcm(a,b):
    return a*b//gcd(a,b)
for e in A:
    t = lcm(e,t)

ans = 0
for e in A:
    ans += t//e

print(ans%MOD)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
MOD = 10**9 + 7
t = A[0]

def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)
def lcm(a,b):
    return a*b//gcd(a,b)
for e in A:
    t = lcm(e,t)

ans = 0
for e in A:
    ans += t//e
    ans %= MOD
print(ans)


Fixed submission:
N = int(input())
A = list(map(int,input().split()))
MOD = 10**9 + 7
t = A[0]

def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)
def lcm(a,b):
    return a*b//gcd(a,b)
for e in A:
    t = lcm(e,t)

ans = 0
for e in A:
    ans += t//e

print(ans%MOD)