Problem:


Score : 300 points

Problem Statement

We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds.

Initially, the hand of every clock stands still, pointing directly upward.

Now, Dolphin starts all the clocks simultaneously.

In how many seconds will the hand of every clock point directly upward again?

Constraints

1≤N≤100 

1≤T_i≤10^{18} 

All input values are integers.  

The correct answer is at most 10^{18} seconds.

Input

Input is given from Standard Input in the following format:  

N
T_1
:  
T_N

Output

Print the number of seconds after which the hand of every clock point directly upward again.

Sample Input 1

2
2
3

Sample Output 1

6

We have two clocks. The time when the hand of each clock points upward is as follows:

Clock 1: 2, 4, 6, ... seconds after the beginning

Clock 2: 3, 6, 9, ... seconds after the beginning

Therefore, it takes 6 seconds until the hands of both clocks point directly upward.

Sample Input 2

5
2
5
10
1000000000000000000
1000000000000000000

Sample Output 2

1000000000000000000



Sample input:
2
2
3


Sample output:
6

Submission status: Runtime Error

Solution code:
import fractions
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)
N=int(input())
T=[]
for i in range(N):
  t=int(input())
  T.append(t)
lcm_list(T)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3

N = int(input())
# S = input()
# N, K = map(int, input().split())
# A = list(map(int, input().split()))
mod = 10 ** 9
from functools import reduce
from fractions import gcd

def main():
    T = sorted(list(set([int(input()) for _ in range(N)])))
    if len(T) == 1:
        print(T[0])
        exit()
    ans = (T[0] * T[1]) // gcd(T[0], T[1])
    for i in range(len(T) - 2):
        ans = int(ans / gcd(ans, T[i + 2]) * T[i + 2])
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3

N = int(input())
# S = input()
# N, K = map(int, input().split())
# A = list(map(int, input().split()))
mod = 10 ** 9
from functools import reduce
from fractions import gcd

def main():
    T = sorted(list(set([int(input()) for _ in range(N)])))
    if len(T) == 1:
        print(T[0])
        exit()
    ans = (T[0] * T[1]) // gcd(T[0], T[1])
    for i in range(len(T) - 2):
        ans = round(ans / gcd(ans, T[i + 2]) * T[i + 2])
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3

N = int(input())
# S = input()
# N, K = map(int, input().split())
# A = list(map(int, input().split()))
mod = 10 ** 9
from functools import reduce
from fractions import gcd

def main():
    T = list(set([int(input()) for _ in range(N)]))
    if len(T) == 1:
        print(T[0])
        exit()
    ans = (T[0] * T[1]) // gcd(T[0], T[1])
    for i in range(len(T) - 2):
        ans = round(ans / (gcd(ans, T[i])) * T[i])
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
import math

from sys import stdin


def main():
    n = int(stdin.readline())
    t = [int(stdin.readline()) for _ in range(n)]
    dp = [0 for _ in range(n)]
    dp[0] = t[0]
    for i in range(1, n):
        dp[i] = t[i] * dp[i-1] // math.gcd(t[i], dp[i-1])
    print(dp[-1])


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
import numpy as np

from sys import stdin


def main():
    n = int(stdin.readline())
    t = [int(stdin.readline()) for _ in range(n)]
    print(np.lcm.reduce(t))


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
n = int(input())
t = [int(input()) for _ in range(n)]


def gcd(x,y):
  if y == 0:
    return x
  return gcd(y, x % y)


ans = t[0]
for x in t[1:]:
  ans = ans * t[i] // gcd(ans, t[i])
print(ans)

Submission status: Runtime Error

Solution code:
import math
N = int(input())
A = []
for _ in range(N):
    A.append(int(input()))
ans = 1
for i in range(N):
    ans = ans*A[i]//math.gcd(ans,A[i])
print(ans)

Submission status: Runtime Error

Solution code:
def gcd(a, b):
	"""Compute the greatest common divisor of a and b"""
	while b > 0:
		a, b = b, a % b
	return a

def lcm(a, b):
	"""Compute the lowest common multiple of a and b"""
	return a * b / gcd(a, b)

def resolve():
	n = int(input())
	T = []
	for _ in range(n):
		T.append(int(input()))
	ans = 1
	for i in range(n):
		ans = lcm(ans, T[i])
	print(int(ans))
resolve()

Submission status: Runtime Error

Solution code:
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)

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

n = int(input())
t = [int(input()) for i in range(n)]
ans = lcm(t[0], t[1])
for i in range(2, n):
    ans = lcm(ans, t[i])
print(ans)

Submission status: Runtime Error

Solution code:
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

n = int(input())
t = [int(input()) for i in range(n)]
ans = lcm(t[0], t[1])
for i in range(2, n):
    ans = lcm(ans, t[i])
print(ans)

Submission status: Runtime Error

Solution code:
import math

def nlcm(t):
    res = 1
    for a in t:
        res *= a // math.gcd(a,res)
    return res

n = int(input())
T = [int(input()) for i in range(n)]

print(nlcm(T))

Submission status: Runtime Error

Solution code:
import math
N = int(input())
current_lcm = None
for _ in range(N):
    t = int(input())
    if current_lcm is None:
        current_lcm = t
        continue
    current_lcm = current_lcm // math.gcd(current_lcm, t)
    current_lcm *= t
print(current_lcm)

Submission status: Runtime Error

Solution code:
import math
N = int(input())
current_lcm = None
for _ in range(N):
    t = int(input())
    if current_lcm is None:
        current_lcm = t
        continue
    current_lcm = current_lcm * t // math.gcd(current_lcm, t)
print(current_lcm)

Submission status: Runtime Error

Solution code:
import math
A = int(input())
ans = int(input())
for i in range(A-1):
    B = int(input())
    ans = B * ans // math.gcd(ans,B)
print(ans)

Submission status: Runtime Error

Solution code:
from math import gcd
n = int(input())
t_list = [int(input()) for i in range(n)]
ans = t_list[0]
for i in range(1,n):
    ans = ans * t_list[i] // gcd(ans,t_list[i])
print(ans)

Submission status: Runtime Error

Solution code:
import math
from functools import reduce

N = int(input())
T = [int(input()) for _ in range(N)]

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

print(lcm_list(T))

Submission status: Runtime Error

Solution code:
import math
from functools import reduce

N = int(input())
T = [int(input()) for _ in range(N)]

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

print(lcm_list(T))

Submission status: Runtime Error

Solution code:
import math
from functools import reduce

N = int(input())
T = [int(input()) for _ in range(N)]

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

print(lcm_list(T))

Submission status: Runtime Error

Solution code:
from math import gcd
from functools import reduce
import sys

lcm = lambda x, y : x*y // gcd(x, y)
N, *T = map(int, sys.stdin.read().split())
ans = reduce(lcm, T)
print(ans)

Submission status: Runtime Error

Solution code:
from math import gcd

n = int(input())


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


ans = 1
for _ in range(n):
    t = int(input())
    ans = lcm(ans, t)

print(ans)

Submission status: Runtime Error

Solution code:
import math

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

N = int(input())
ans = 1

for i in range(N):
    tmp = int(input())
    ans = lcm(ans, tmp)

print(ans)

Submission status: Runtime Error

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

from math import gcd

n = int(readline())
t = [int(readline()) for _ in range(n)]
ans = t[0]
for tt in t:
    ans = ans * tt // gcd(ans, tt)
print(ans)

Submission status: Runtime Error

Solution code:
import fractions

n = int(input())
t = [0] * n
for i in range(n):
    t[i] = int(input())

ans = t[0]
for i in range(1,n):
    ans = ans * a[i] // fractions.gcd(ans,a[i])
print(ans)

Submission status: Runtime Error

Solution code:
import fractions
ans=1
N=int(input())
list=[]

for i in range(N):
    a=int(input())
    list.append(a)

X=[x for x in set(list)]

def lcm(a,b):
    x=int((a*b)/fractions.gcd(a,b))
    return x

for i in range(0,len(X)):
    ans=lcm(X[i],ans)

print(ans)

Submission status: Runtime Error

Solution code:
import fractions
ans=1
N=int(input())
list=[]

for i in range(N):
    a=int(input())
    list.append(a)

X=[x for x in set(list)]

def lcm(a,b):
    x=int((a*b)/math.fractions(a,b))
    return x

for i in range(0,len(X)):
    ans=lcm(X[i],ans)

print(ans)

Submission status: Runtime Error

Solution code:
import math
ans=1
N=int(input())
list=[]

for i in range(N):
    a=int(input())
    list.append(a)

X=[x for x in set(list)]

if 0 in X:
    X.remove(0)

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

for i in range(0,len(X)):
    ans=lcm(X[i],ans)

print(ans)

Submission status: Runtime Error

Solution code:
import math
ans=1
N=int(input())
list=[]

for i in range(N):
    a=int(input())
    list.append(a)

X=[x for x in set(list)]

if 0 in X:
    X.remove(0)

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

for i in range(0,len(X)):
    ans=lcm(X[i],ans)

print(ans)

Submission status: Runtime Error

Solution code:
import math
ans=1
N=int(input())
list=[]

for i in range(N):
    a=int(input())
    list.append(a)

X=[x for x in set(list)]

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

for i in range(0,len(list)):
    ans=lcm(list[i],ans)

print(ans)

Submission status: Runtime Error

Solution code:
import math
ans=1
N=int(input())
list=[]

for i in range(N):
    a=int(input())
    list.append(a)

X=[x for x in set(list)]

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

for i in range(0,len(X)):
    ans=lcm(X[i],ans)

print(ans)

Submission status: Runtime Error

Solution code:
import math
N=int(input())
ans=1
list=[]

for i in range(N):
    a=int(input())
    list.append(a)

X=[x for x in set(list)]

for i in range(0,len(X)):
    ans=(X[i]*ans)//(math.gcd(X[i],ans))

print(ans)

Submission status: Runtime Error

Solution code:
import math
N=int(input())
ans=1
list=[]

for i in range(N):
    a=int(input())
    list.append(a)

X=[x for x in set(list)]

if X[0]<2:
    del X[0]
else:
    pass

for i in range(0,len(X)):
    ans=(X[i]*ans)//(math.gcd(X[i],ans))

print(ans)

Submission status: Runtime Error

Solution code:
import math
N=int(input())
ans=1
list=[]
for i in range(N):
    a=int(input())
    list.append(a)
X=[x for x in set(list)]

if 1 in X:
    X.remove(1)
else:
    pass


for i in range(0,len(X)):
    ans=(X[i]*ans)//(math.gcd(X[i],ans))
print(ans)

Submission status: Runtime Error

Solution code:
import math
N=int(input())
list=[]
for i in range(N):
    a=int(input())
    list.append(a)
X=[x for x in set(list)]
if 1 in X:
    X.remove(1)
ans=int((X[0]*X[1])/(math.gcd(X[0],X[1])))
if len(X)==1:
    print(X[0])
else:
    for i in range(1,len(X)-1):
        ans=int((X[i]*ans)/(math.gcd(X[i],ans)))
print(ans)

Submission status: Runtime Error

Solution code:
import math
N=int(input())
list=[]
for i in range(N):
    a=int(input())
    list.append(a)
X=[x for x in set(list)]
if 1 in X:
    X.pop(1)
ans=int((X[0]*X[1])/(math.gcd(X[0],X[1])))
if len(X)==1:
    print(X[0])
else:
    for i in range(1,len(X)-1):
        ans=int((X[i]*ans)/(math.gcd(X[i],ans)))
print(ans)

Submission status: Runtime Error

Solution code:
from math import gcd
from functools import reduce
from collections import deque
# from math import factorial
import sys
sys.setrecursionlimit(2000000)
# import math
# import itertools
# import statistics
# import numpy as np
# import collections
n = int(input())
# = list(map(int, input().split()))
t = []
for i in range(n):
    t.append(int(input()))


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


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


print(lcm_list(t))

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(n) begin(n), end(n)
using ll = long long;
using namespace std;
 
int main(){
  int n;
  cin >> n;
  ll ans;
  rep(i, n){
    ll t;
    cin >> t;
    if(i == 0) ans = t;
    else{
      ll g = __gcd(ans, t);
      ans = t / g * ans;
    }
  }
  cout << ans << endl;
  return 0;
}

Submission status: Runtime Error

Solution code:
def resolve():
    nclo=range(int(input()))
    from math import gcd
    def lcm(a,b):
        return (a*b)//gcd(a,b)
    next=0
    temp=1
    for i in nclo:
        next=int(input())
        temp=lcm(temp,next)
    print(temp)
        
#%%submit!
resolve()

Submission status: Runtime Error

Solution code:
from collections import gcd

N = int(input())

t = int(input())
ans = t
for _ in range(N - 1):
    tmp = int(input())
    t = gcd(ans, tmp)
    ans *= tmp
    ans //= t

print (ans)

Submission status: Runtime Error

Solution code:
from math import gcd

N = int(input())

t = int(input())
ans = t
for _ in range(N - 1):
    tmp = int(input())
    t = gcd(ans, tmp)
    ans *= tmp
    ans //= t

print (ans)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
import math

N = int(input())
T = [int(input()) for _ in range(N)]

ans = 1
for i in range(N):
    ans = ans * T[i] // math.gcd(ans, T[i])
print(ans)

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    from math import gcd
    N=I()
    ans=1
    for i in range(N):
        T=I()
        ans=(ans*T)//(gcd(ans,T))
        
        
    print(ans)

main()

Submission status: Runtime Error

Solution code:
from math import gcd
n = int(input())

ans = 1
for i in range(n):
    t = int(input())
    ans = ans * t // gcd(ans, t)

print(ans)

Submission status: Runtime Error

Solution code:
from fraction import gcd
n = int(input())

ans = 1
for i in range(n):
    t = int(input())
    ans = ans * t // gcd(ans, t)

print(ans)

Submission status: Runtime Error

Solution code:
import fractions
import sys
#import numpy as np

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

def main():
    N = int(input())
    for i in range(N):
        if i == 0:
            tmp = int(input())
        else:
            a = int(input())
            b = lcm_base(a, tmp)
            tmp = b
    print(b)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
import fractions
import sys
#import numpy as np

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

def main():
    N = int(input())
    for i in range(N):
        if i == 0:
            tmp = int(input())
        else:
            a = int(input())
            b = lcm_base(a, tmp)
            tmp = b
    print(b)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
import math
import sys

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

def main():
    N = int(input())
    for i in range(N):
        if i == 0:
            tmp = int(input())
        else:
            a = int(input())
            b = lcm_base(a, tmp)
            tmp = b
    print(b)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
import math

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

def main():
    N = int(input())
    for i in range(N):
        if i == 0:
            b = int(input())
        else:
            a = int(input())
            b = lcm_base(a, b)
    print(b)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
from fractions import gcd

N = int(input())
T = list(map(int, input().split()))
ans = 1

for i in range(0,N):
    ans = ans * T[i] / gcd(ans, T[i])
    
print(int(ans))

Submission status: Runtime Error

Solution code:
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)

n = int(input())
t = [int(input()) for i in range(n)]

print(lcm(*t))

Submission status: Runtime Error

Solution code:
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)

n = int(input())
t = [int(input()) for i in range(n)]

print(lcm_list(t))

Submission status: Runtime Error

Solution code:
import math

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

n=int(input())
ans=0
ans=int(input())
if n==1:
    print(ans)
    exit()

for i in range(n-1):
    t=int(input())
    ans=lcm(ans,t)

print(ans)

Submission status: Runtime Error

Solution code:
import numpy as np
n=int(input())
a = list( int(input()) for _ in range(n))
#print(np.lcm.reduce(a1))
ans = 1
from math import gcd
for ai in a:
    ans = ans*ai//gcd(ans,ai)
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
t = [int(input()) for i in range(n)]


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


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


print(lcm_list(t))

Submission status: Runtime Error

Solution code:
import fractions
def lcm(x, y):
    return x * y / fractions.gcd(x, y)

n = int(input())
i = 1
for _ in range(n):
    i = int(lcm(i, int(input())))
print(i)

Submission status: Runtime Error

Solution code:
from collections import deque
from heapq import heapify,heappop,heappush,heappushpop
from copy import copy,deepcopy
from itertools import permutations,combinations
from collections import defaultdict,Counter
from math import gcd
from functools import reduce
from pprint import pprint

def myinput():
    return map(int,input().split())

def mylistinput(n):
    return [ list(myinput()) for _ in range(n) ]

def mycol(data,col):
    return [ row[col] for row in data ]

def mysort(data,col):
    data.sort(key=lambda x:x[col],reverse=False)
    return data

def mymax(data):
    M = -1*float("inf")
    for i in range(len(data)):
        m = max(data[i])
        M = max(M,m)
    return M

def mymin(data):
    m = float("inf")
    for i in range(len(data)):
        M = min(data[i])
        m = min(m,M)
    return m

n = int(input())
t = [ int(input()) for _ in range(n) ]
# print(t)

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

ans = lcm_list(t)
print(ans)

Submission status: Runtime Error

Solution code:
import math
def lcm(a,b):
    return (a*b) // math.gcd(a,b)
n = int(input())
t = []
for i in range(n):
    a = int(input())
    t.append(a)
b = t[0]
for i in range(1,n):
    b = lcm(b,t[i])
print(b)

Submission status: Runtime Error

Solution code:
import sys
import math

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

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

N = ir()
start = ir()
next = 0
for n in range(1, N):
    next = ir()
    start = lcm(start, next)

print(start)

Submission status: Runtime Error

Solution code:
解答例
from fractions import gcd
def lcm(a,b): return a*b//gcd(a,b)
N=int(input())
ans=1
for i in range(N):
    t=int(input())
    ans=lcm(ans,t)
print(ans)

Submission status: Runtime Error

Solution code:
# import sys
# sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

import fractions as math

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

def solve():
    n = II()
    T = [II() for _ in range(n)]

    t1 = T[0]
    for t2 in T[1:]:
        l = lcm(t1, t2)
        t1 = l
    print(l)


if __name__ == '__main__':
    solve()

Submission status: Runtime Error

Solution code:
# import sys
# sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

import math

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

def solve():
    n = II()
    T = [II() for _ in range(n)]

    t1 = T[0]
    for t2 in T[1:]:
        l = lcm(t1, t2)
        t1 = l
    print(l)


if __name__ == '__main__':
    solve()

Submission status: Runtime Error

Solution code:
import math
N = int(input())
S_t = 1
for i in range(N):
    t = int(input())
    S_t =  S_t * t // math.gcd(S_t,t)

print(S_t)

Submission status: Runtime Error

Solution code:
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)

n = int(input())
list_T = [int(input()) for _ in range(n)]

print(lcm_list(list_T))

Submission status: Runtime Error

Solution code:
import math
n = int(input())
l = list(int(input()) for _ in range(n))
ans = l[0]
for i in range(1, n):
    ans = ans * l[i] // math.gcd(ans, l[i])

print(ans)

Submission status: Runtime Error

Solution code:
import math
def sks(a,b):
    return (a*b)//math.gcd(a,b)

c=int(input())
result=1
for a in range(c):
    result=sks(result,int(input()))
print(result)

Submission status: Runtime Error

Solution code:
import numpy as np

n = int(input())
t = [int(input()) for i in range(n)]

ans = np.lcm.reduce(t)
print(ans)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**9)

n=int(input())
t=list(set([int(input()) for _ in range(n)]))
T=max(t)

def f(j):
  for i in t:
    if (T*j)%i!=0:
      return f(j+1)
      break
  return T*j

print(f(1))

Submission status: Runtime Error

Solution code:
n = int(input())
t = sorted([int(input()) for _ in range(n)],reverse = True)
def c_mul(x,y):
  d = x
  e = y
  while y%x != 0:
    z = y%x
    y = x
    x = z
  else:
    return d*e//x
for i in range(1,n):
  a = c_mul(t[0],t[i])
  if a != t[0]:
    t[0] = a
print(a)

Submission status: Runtime Error

Solution code:
def gcd_core(a, b):
    if b == 0:
        return a
    else:
        return gcd_core(b, a % b)

def gcd(arr):
    g = gcd_core(arr[0], arr[1])
    for i in range(2, len(arr)):
        g = gcd_core(g, arr[i])
    return g

def lcm_core(a,b):
    g = gcd_core(a,b)
    return (a*b)//g

def lcm(arr):
    l = lcm_core(arr[0],arr[1])
    for i in range(2,len(arr)):
        l = lcm_core(l,arr[i])
    return l

N = int(input())
T = [int(input()) for _ in range(N)]

print(lcm(T))

Submission status: Runtime Error

Solution code:
import math
from functools import reduce

n = int(input())

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

t = set()
for _ in range(n):
    t.add(int(input()))

print(lcm_list(t))

Submission status: Runtime Error

Solution code:
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)
N=int(input())
T=[]
for i in range(N):
    Ti=int(input())
    T.append(Ti)
print(lcm_list(T))

Submission status: Runtime Error

Solution code:
import math
def multi_lcm(a):
    ans = a[0]
    for i in range(1, len(a)):
        ans = ans * a[i] // fractions.gcd(ans, a[i])
    return ans

N = int(input())
T = [int(input()) for _ in range(N)]
print(multi_lcm(T))

Submission status: Runtime Error

Solution code:
def resolve():
    '''
    code here
    '''
    import sys
    sys.setrecursionlimit(10000000)
    N = int(input())
    T_list = [int(input()) for _ in range(N)]

    def gcd(a, b):
        if b == 0:
            return a
        else:
            return gcd(b, a%b)

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

    res = 1
    for i in T_list:
        res = lcm(res, i)
        # print(res, i)

    print(res)

if __name__ == "__main__":
    resolve()

Submission status: Runtime Error

Solution code:
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)

n = int(input())
t = [int(input()) for i in range(n)]
print(lcm_list(t))

Submission status: Runtime Error

Solution code:
from math import gcd
n = int(input())
T = [int(input()) for i in range(n)]
ans = 1
for t in T:
    ans = int(ans*t/gcd(ans,t))
print(ans)

Submission status: Runtime Error

Solution code:
from math import gcd
n = int(input())
T = [int(input()) for i in range(n)]
ans = 1
for t in T:
    ans = ans*t//gcd(ans,t)
print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
T=[]
for _ in range(n):
    t = int(input())
    T.append(t)

def gcd(a,b):
    while b:
        a,b=b,a%b
    return a

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

for i in range(n-1):
    ans=lcm(T[i], T[i+1])

print(ans)

Submission status: Runtime Error

Solution code:
import math
n=int(input())
t=[int(input()) for _ in range(n)]

ans=t[0]

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

for i in range(1,n):
    ans=lcm(ans,t[i])
print(ans)

Submission status: Runtime Error

Solution code:
import math as mt
n=int(input())
t=[int(input()) for _ in range(n)]

ans=t[0]
def lcm(x,y):
    return (x*y)//mt.gcd(x,y)
for i in range(1,n):
    ans=lcm(ans,t[i])
print(ans)

Submission status: Runtime Error

Solution code:
def gcd(p, q):
    if p < q:
        p, q = q, p
    while q > 0:
        p, q = q, p%q
    return p

n = int(input())
ans = 1
for i in range(n):
  t = int(input())
  ans = a*t//gcd(a, t)
print(ans)

Submission status: Runtime Error

Solution code:
from fractions import gcd
n = int(input())
ans = 1
for i in range(n):
  t = int(input())
  ans = a*t//gcd(a, t)
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
T_arr = []
for _ in range(N):
    T_arr.append(int(input()))
    




import fractions
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)


print(lcm_list(T_arr))

Submission status: Runtime Error

Solution code:
N = int(input())
T_arr = []
for _ in range(N):
    T_arr.append(int(input()))
    




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)


print(lcm_list(T_arr))

Submission status: Runtime Error

Solution code:
from fractions import gcd 

def lcd(x, y):
    return (x*y)/gcd(x, y)

N = int(input())
T = [0]*N
for i in range(N):
    T[i] = int(input())

num = lcd(T[0], T[1])    
    
for i in range(2, N):
    num = lcd(num, T[i])
print(int(num))

Submission status: Runtime Error

Solution code:
import fractions
n = int(input())
l = [int(input()) for _ in range(n)]
ans = l[i]
for i in range(n):
  ans = ans * l[i] // fractions.gcd(ans, l[i])
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
import math
def main():
    m = int(input())
    for _ in range(n-1):
        t = int(input())
        m = m*t//math.gcd(m,t)

    print(m)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
#include<iostream>
#include<cstring>
#include<algorithm>
#include<vector>
#include<cmath>
#include<queue>
#include<limits>
#include<map>
#define ll long long
#define ALL(x) (x).begin(),(x).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define int_INF 2147483647
#define ll_INF 	9223372036854775807
const static ll MOD = 1e9+7;
#define vi vector<int>
#define vii vector<vector<int>>
#define vll vector<long long>
#define pii pair<int,int>
#define vpii vector<pair<int,int>>
using namespace std;
namespace Arithmetics {
  template<typename T>
  T original_pow(T a, T b) {
  	T ans = 1;
  	rep(i, b) {
  		ans *= a;
  	}

  	return  ans;
  }
  template<typename T>
  T gcd(T a, T b) {
  	if (a > b) {
  		T c = a;
  		a = b;
  		b = c;
  	}
  	if (a == 0) {
  		return b;
  	}

  	return gcd(b % a, a);
  }
  template<typename T>
  T gcd_of_all(vector<T> v){
    T temp = v[0];
    for(T elem: v){
      temp = gcd(temp,elem);
    }

    return temp;
  }
  template<typename T>
  T lcm(T a, T b){
  	T GCD = gcd(a,b);
  	return a /GCD * b;
  }
  template<typename T>
  T lcm_of_all(vector<T> v){
    T temp = v[0];
    for(T elem: v){
      temp = lcm(temp,elem);
    }
    return temp;
  }
}
using namespace Arithmetics;
int main(){
  ll N; cin >> N;
  vector<ll> T(N);
  for(ll& t: T){
    cin >> t;
  }

  ll ans = lcm_of_all(T);
  cout << ans << endl;
}

Submission status: Runtime Error

Solution code:
from math import gcd
n = int(input())
ans = 1
for i in range(n):
    t = int(input())
    if ans%t!=0:
        ans = ans*t//gcd(ans,t)
print(ans)

Submission status: Runtime Error

Solution code:
from math import gcd

def lcm(x, y):
   lcm = (x*y)//gcd(x,y)
   return lcm

n = int(input())
ans1 = 1
for _ in range(n):
    t=int(input())
    ans1 = lcm(ans1, t)
print(ans1)

Submission status: Runtime Error

Solution code:
import numpy as np
def lcd(a,b):
  return a*b//np.gcd(a,b)
N=int(input())
T=int(input())
for i in range(N-1):
  t=int(input())
  T=lcd(t,T)
print(T)

Submission status: Runtime Error

Solution code:
from math import gcd
def lcm(a,b):
  return a*b//gcd(a,b)
N=int(input())
T=int(input())
for i in range(N-1):
  t=int(input())
  T=lcm(T,t)
print(T)

Submission status: Runtime Error

Solution code:
import math
def lcm(a, b):
    return (a*b)//math.gcd(a,b)
n = int(input())
ans = 1
for i in range(n):
    tmp = int(input())
    ans=lcm(ans,tmp)
print(ans)

Submission status: Runtime Error

Solution code:
def fcd(a , b):
    
    if a>= b:
        while b != 0:
            a,b = b,a%b
        return a
    
    else:
        while a != 0:
            b,a = a,b%a
        return b
    
    
def lcm(a,b):
    return int(a*b/fcd(a , b))


n = int(input())
t_list = []
ans_list = []
for i in range(n):
    t_list.append(int(input()))
    
    
for i in range(len(t_list)):
    if i == 0:
        ans_list.append(t_list[0])
        continue
    if i == 1:
        ans_list.append(lcm(t_list[0] , t_list[1]))
    
    if i >=2:
        ans_list.append(lcm(ans_list[-1],t_list[i]))
print(ans_list[-1])

Submission status: Runtime Error

Solution code:
def fcd(a , b):
    
    if a>= b:
        while b != 0:
            a,b = b,a%b
        return a
    
    else:
        while a != 0:
            b,a = a,b%a
        return b
    
    
def lcm(a,b):
    return int(a*b/fcd(a , b))


n = int(input())
t_list = []
ans_list = []
for i in range(n):
    t_list.append(int(input()))
    
    
for i in range(len(t_list)):
    if i == 0:
        ans_list.append(t_list[0])
        continue
    if i == 1:
        ans_list.append(lcm(t_list[0] , t_list[1]))
    
    if i >=2:
        ans_list.append(lcm(ans_list[i-1],t_list[i]))
print(ans_list[-1])