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

Solution (Python):
from math import gcd
from functools import reduce

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

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

print(reduce(lcm, TS))

Solution (Python):
from math import gcd
n = int(input())
T = []
for i in range(n):
    T.append(int(input()))

tmp = T[0]
for i in range(1,n):
    g = gcd(tmp,T[i])
    tmp = T[i]*tmp//g
    
print(tmp)

Solution (Python):
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())
N_List = []
for i in range(N):
    N_List.append(int(input()))

print(lcm_list(N_List))

Solution (Python):
import numpy as np
n = int(input())
lis = []
for i in range(n):
    lis.append(int(input()))
print(np.lcm.reduce(lis))

Solution (Python):

"""
Created on Sat Sep 26 22:43:32 2020

@author: liang
"""

from math import gcd

N = int(input())
T = [int(input()) for i in range(N)]
ans = 1

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

print(ans)

Solution (Python):
import math
from functools import reduce

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

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

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

print(lcm_list(T))

Solution (Python):
import math
from functools import reduce

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

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

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

print(lcm_list(T))

Solution (Python):
import math
        
N = int(input())
T = []
for i in range(N):
    T.append(int(input()))
ans = T[0]

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

print(ans)

Solution (Python):
n = int(input())
T = [int(input()) for _ in range(n)]

def gcd(a, b):
  if a > b:
    a, b = b, a
  while a % b != 0:
    a, b = b, a % b
  return b

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

l = T.pop()
for t in T:
  l = lcm(l, t)
print(l)

Solution (Python):
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())
AA = [int(input()) for i in range(N)]
print(lcm(*AA))

Solution (Python):
import math
N = int(input())
ans = 1
for i in range(N):
  a = int(input())
  ans = ans*a//math.gcd(ans,a)
print(ans)

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


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

ans = T[0]
for t in T[1:]:
    ans = lcm(ans, t)
print(ans)

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
from math import gcd
g = 0
ans = 1
for _ in range(N):
    t = int(input())
    g = gcd(t, ans)
    ans = t*ans//g
print(ans)

Solution (Python):
def gcd(x,y):
    while y>0:
        x,y = y,x%y
    return x
N=int(input())
T = [int(input()) for _ in range(N)]
a = T[0]
for i in range(1,N):
    b = T[i]
    c = gcd(a,b)
    a = (a//c)*b
print(a)

Solution (Python):
import math

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

ans = 1
for i in t:
    ans = ans*i // math.gcd(ans, i)
print(ans)

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

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

Solution (Python):
import math

n = int(input())
ans = 1
for _ in range(n):
    t1 = int(input())
    ans = ans//math.gcd(ans, t1)*t1

print(ans)

Solution (Python):
from math import gcd
n = int(input())
ans = int(input())
for _ in range(n - 1):
    t = int(input())
    ans = (ans * t) // gcd(ans, t)

print(ans)

Solution (Python):
from math import gcd
def lcm(x,y):
    return (x*y)//gcd(x,y)
N=int(input())
ans=1
for i in range(N):
    ans=lcm(ans,int(input()))
print(ans)

Solution (Python):
N = int(input())
T = []

for i in range(N):
  T.append(int(input()))

import math

def lcm(m,n):
  return (m*n)//math.gcd(m,n)

def lcm_list(nums):
  lcm_num = nums[0]
  for i in range(1,len(nums)):
    lcm_num = lcm(lcm_num,nums[i])
  return lcm_num

print(lcm_list(T))

Solution (Python):
n = int(input())
from fractions import gcd
g = int(input())
for i in range(n-1):
  h = int(input())
  g = g * h // gcd(g,h)
print(g)

Solution (Python):
import math

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

Solution (Python):
import math

n = int(input())
tl = list(int(input()) for _ in range(n))

if n == 1:
    print(tl[0])
else:
    ans = tl[0]
    for i in range(1, n):
        ans = ans//math.gcd(ans, tl[i])*tl[i]

    print(ans)

Solution (Python):
import math
N = int(input())
T = int(input())
for i in range(N-1):
    t = int(input())
    T = T // math.gcd(T, t) * t
print(T)

Solution (Python):
import sys
import math
pin=sys.stdin.readline

def main():
  N=int(pin())
  ans=int(pin())
  for i in range(N-1):
    T=int(pin())
    ans=(ans*T)//math.gcd(ans,T)
  print(ans)
  return
main()

Solution (Python):
from math import gcd
n = int(input())
a = 1
for _ in range(n):
  x = int(input())
  a = a // gcd(a, x) * x
print(a)

Solution (Python):
import fractions
def lcm(x,y):
    return (x*y)//fractions.gcd(x,y)
n=int(input())
t=[0]*n
num=1
for i in range(n):
    t[i]=int(input())
    num=lcm(num,t[i])
print(num)

Solution (Python):
from math import gcd
N = int(input())
def lcm(a,b):
    return a*b//gcd(a,b)

T1 = int(input())
ans = T1
for i in range(N-1):
    T2 = int(input())
    ans = lcm(ans,T2)
    T1 = T2

print(ans)

Solution (Python):
import math
N = int(input())
T = [int(input()) for _ in range(N)]

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

ans = T[0]
for i in range(1, N):
    ans = lcm(ans, T[i])
print(ans)

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

def lcm(a,b):
    return a*b//gcd(a,b)
      
N=int(input())
T=[]
total=1
for i in range(N):
    a=int(input())
    T.append(a)
T_set=sorted(list(set(T)))
M=len(T_set)

ans=T_set[0]
if M==1:
    ans=T_set[0]
else:
    for i in range(1,M):
        ans=lcm(ans,T_set[i])

print(ans)

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

arr = [int(input()) for i in range(int(input()))]
ans = 1
for i in arr:
  ans = (ans*i)//gcd(ans, i)
print(ans)

Solution (Python):
import math
from functools import reduce


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

x = 1

def lcm_base(x,y):
  return (x*y) // math.gcd(x,y)
def lcm(*numbers):
  return reduce(lcm_base, numbers, 1)

print(lcm(*tt))

Solution (Python):
def gcd(a,b):
    while b!=0:
        a, b = b, a%b
    return a

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

N = int(input())
T = [int(input()) for _ in range(N)]
ans = 1
for t in T:
    ans = lcm(ans, t)
print(ans)

Solution (Python):
def main():
    def gcd(a,b):
        while b!=0:
            a, b = b, a%b
        return a

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

    N = int(input())
    T = [int(input()) for _ in range(N)]
    ans = 1
    for t in T:
        ans = lcm(ans, t)
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
def gcd(a,b):
    while b!=0:
        tmp = b
        b = a%b
        a = tmp
    return a

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

N = int(input())
T = [int(input()) for _ in range(N)]
ans = 1
for t in T:
    ans = lcm(ans, t)
print(ans)

Solution (Python):
import math

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

n = int(input())
t = int(input())

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

Solution (Python):
import math


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


def main():
    n = int(input())
    t_lst = [int(input()) for _ in range(n)]
    t_lst.sort()
    answer = t_lst[0]
    for i in range(1, n):
        t = t_lst[i]
        answer = lcm(answer, t)

    print(answer)


if __name__ == '__main__':
    main()

Solution (Python):
import math
n=int(input())
t=[int(input()) for i in range(n)]
res=t[0]
for i in range(1,n):
  res=res*t[i]//math.gcd(res,t[i])
print(res)

Solution (Python):
import math
from functools import reduce


def gcd(*numbers):  
    return reduce(math.gcd, numbers)


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


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


def main():
    n = int(input())
    t = []
    for i in range(n):
        t.append(int(input()))

    answer = lcm(*t)

    print(answer)


if __name__ == "__main__":
    main()

Solution (Python):
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))

Solution (Python):
N = int(input())
ti = [int(input()) for i in range(N)]


def euc_alg(val1, val2):

    if val1 == val2:
        return val1

    mod = min(val1, val2)
    divided = max(val1, val2)
    while 1:
        tmp_mod = divided % mod

        if tmp_mod == 0:
            break
        divided = mod
        mod = tmp_mod

    ret = val1 * val2 // mod

    return ret

maxti = max(ti)


ans = ti[0]
for t in ti:
    ans = euc_alg(ans, t)

print(ans)

Solution (Python):
import math

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

n = int(input())

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

print(ans)

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

Solution (Python):
import numpy as np
with open(0) as f:
    N, *T = map(int, f.read().split())
ans = 1
for t in T:
    ans = np.lcm(ans, t)
print(ans)

Solution (Python):
import math
n=int(input())
t=[int(input()) for i in range(n)]
res=t[0]
for i in range(1,n):
  res=res*t[i]//math.gcd(res,t[i])
print(res)

Solution (Python):
import math

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

N=int(input())
T=[int(input()) for _ in range(N)]
ans=1
for t in T:
    ans=lcm(ans,t)
print(ans)

Solution (Python):
import math

def main():
    N = int(input())
    T = [int(input()) for _ in range(N)]
    lcm = 1
    for t in T:
        lcm = lcm * t // math.gcd(lcm, t)
    print(lcm)


if __name__ == '__main__':
    main()

Solution (Python):

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

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

def all_lcm(A):
    ans = functools.reduce(lcm,A,1)
    return ans

print(all_lcm(T))

Solution (Python):
from math import gcd
N = int(input())
ans = 1
for i in range(N):
  n = int(input())
  ans = ans * n // gcd(ans, n)
print(ans)

Solution (Python):
def gcd(x, y):
    if(y == 0):
        return x
        
    return gcd(y, x%y)
    
def lcm(x, y):
    return (x*y)//(gcd(x, y))


n = int(input())
x = []
for i in range(n):
    x.append(int(input()))
        
l = x[0]
for i in range(1, n):
    l = lcm(l, x[i])
        
print(l)

Solution (Python):
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 _ in range(n)]

print(lcm(*t))

Solution (Python):
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))

Solution (Python):
N=int(input())
T=list(int(input()) for _ in range(N))

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

l=T[0]
for t in T:
	l=l // gcd(l, t) * t
print(l)

Solution (Python):
import sys
from sys import exit
from collections import deque
from bisect import bisect_left, bisect_right, insort_left, insort_right 
from heapq import heapify, heappop, heappush
from itertools import product, permutations, combinations, combinations_with_replacement
from functools import reduce
from math import *

sys.setrecursionlimit(10**6)
INF = 10**20
eps = 1.0e-20
MOD = 10**9+7

def lcm(x,y):
    return x*y//gcd(x,y)
def lgcd(l):
    return reduce(gcd,l)
def llcm(l):
    return reduce(lcm,l)
def mint():
    return map(int,input().split())
def lint():
    return list(map(int,input().split()))
def ilint():
    return int(input()), list(map(int,input().split()))
def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1])
def lprint(l, sep='\n'):
    for x in l:
        print(x, end=sep)
def ston(c, c0='a'):
    return ord(c)-ord(c0)
def ntos(x, c0='a'):
    return chr(x+ord(c0))
class counter(dict):
    def __init__(self, *args):
        super().__init__(args)
    def add(self,x):
        self.setdefault(x,0)
        self[x] += 1

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

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

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

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

ans = 1

for i in range(N):
    ans = lcm(ans, T[i])

print(ans)

Solution (Python):
N=int(input())
T=list(int(input()) for _ in range(N))

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

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

Solution (Python):
from math import gcd as g
n=int(input())
t=[]
for i in range(n):
    t.append(int(input()))
def l(a,b):
    return(a*b//g(a,b))
ans=t[0]
for i in range(n):
    ans=l(ans,t[i])
print(ans)

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

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

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

Solution (Python):
from math import gcd
def lcm(a,b):
  return a*b//gcd(a,b)
N=int(input())
T=[0]*N
for i in range(N):
  T[i]=int(input())
ans=1
for i in range(N):
  ans=lcm(ans,T[i])
print(ans)

Solution (Python):
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 = [int(input()) for _ in range(n)]

print(lcm(*t))

Solution (Python):

import math
from functools import reduce

url = "https://atcoder.jp//contests/abc070/tasks/abc070_c"

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

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

def main():
    count = int(input())
    clocks = []
    for i in range(count):
        clocks.append(int(input()))
    print(lcm(*clocks))

if __name__ == '__main__':
    main()

Solution (Python):

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


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


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

Solution (Python):



import sys
from io import StringIO
import unittest
import math
from functools import reduce


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """2
2
3"""
        output = """6"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """5
2
5
10
1000000000000000000
1000000000000000000"""
        output = """1000000000000000000"""
        self.assertIO(input, output)


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

    print(lcmlist(T))


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


def lcmlist(l):
    return reduce(lcm, l)


if __name__ == "__main__":
    
    resolve()

Solution (Python):
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
    from functools import reduce
    def lcm_base(n1,n2):
        return (n1*n2)//math.gcd(n1,n2)
    def lcm(*numbers):
        return reduce(lcm_base, numbers)

    n = I()
    t = [0 for _ in range(n)]
    for i in range(n):
        t[i] = I()

    ans = lcm(*t)
    print(ans)
main()

Solution (Python):









import os
import sys




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


def main():
    n = int(input())
    ans = int(input())
    for _ in range(n-1):
        t = int(input())
        ans = ans*t//gcd(max(ans, t), min(ans, t))
    print(ans)




if __name__ == "__main__":
    main()

Solution (Python):
from math import *

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

N=int(input())
T=[int(input()) for _ in range(N)]
ans=T[0]
for i in range(1,N):
  ans=lcm(ans,T[i])
print(ans)

Solution (Python):
from math import *

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

Solution (Python):
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())
nums=[int(input()) for i in range(n)]

print(lcm_list(nums))

Solution (Python):
import math
import functools
def lcm(x,y):
    return (x*y)//math.gcd(x,y)
n = int(input())
t = [int(input()) for i in range(n)]
a = functools.reduce(math.gcd,t)
print(functools.reduce(lcm,t))

Solution (Python):
import math
import functools
def lcm(x,y):
    return (x*y)//math.gcd(x,y)
n = int(input())
t = [int(input()) for i in range(n)]
a = functools.reduce(math.gcd,t)
print(functools.reduce(lcm,t))

Solution (Python):
N = int(input())
T = [int(input()) for i in range(N)]
import math
a = T[0]
for i in range(1,N):
    a = (a*T[i]) // math.gcd(a,T[i])
print(a)

Solution (Python):
import math
from math import gcd,pi,sqrt
INF = float("inf")

import sys
sys.setrecursionlimit(10**6)
import itertools
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]


def main():
    n = i_input()
    t = i_input()
    for i in range(n-1):
        k = i_input()
        t = t*k//gcd(t,k)
    print(t)



if __name__=="__main__":
    main()

Solution (Python):


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


def multiple(a, b):
    return a * b // euclid(a, b)


import functools




def lcm(nums):
    return functools.reduce(multiple, nums)

a=[]

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

print(lcm(a))

Solution (Python):
def gcd(m, n):
    if m < n:
        m, n = n, m

    while True:
        r = m % n
        if r == 0:
            return n
        else:
            m, n = n, r

def lcm(m, n):
    return m*n // gcd(m, n)

n = int(input())
l = []

ans = 1

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

print(ans)

Solution (Python):
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())

l = []

for i in range(n):
    t = int(input())
    l.append(t)

print(lcm_list(l))

Solution (Python):
import math
n = int(input())
t = []
for i in range(n):
    t.append(int(input()))
if n == 1:
    print(t[0])
else:
    tmp = t[0]
    for i in range(1,n):
        div = math.gcd(tmp,t[i])
        tmp = (t[i] * tmp)//div
    print(tmp)

Solution (Python):
import math

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

if n == 1:
    print(tl[0])
else:
    g = tl[0] // math.gcd(tl[0], tl[1]) * tl[1]
    for i in range(1, n):
        g = g // math.gcd(g, tl[i]) * tl[i]
    print(g)

Solution (Python):
n=int(input())
A=[]
for i in range(n):
    A.append(int(input()))

import numpy as np
print(np.lcm.reduce(A))

Solution (Python):
import math
N = int(input())
ans = 0
for i in range(N):
  if i == 0:
    ans = int(input())
  else:
    a = int(input())
    ans = (a * ans) // math.gcd(ans,a)
print(ans)

Solution (Python):
from sys import stdin
from math import gcd

def input():
    return stdin.readline().strip()

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

now = l[0]
for i in range(1, n):
    now = now * l[i] // gcd(now, l[i])

print(now)

Solution (Python):
import math
N = int(input())

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

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

Solution (Python):
def lcm(a):
    import math
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // math.gcd(x, a[i])
    return x


def resolve():
    N = int(input())
    T = [int(input()) for _ in range(N)]
    print(lcm(T))


resolve()

Solution (Python):
from functools import reduce
from fractions import gcd

N = int(input())
T = list(int(input()) for _ in range(N))

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

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

print(lcm(T))

Solution (Python):
import math

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


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


ans = tL[0]
for t in tL[1:]:
    ans = lcm(t, ans)

print(ans)

Solution (Python):
from math import gcd
from functools import reduce


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


def main():
    n = int(input())
    t = {int(input()) for _ in range(n)}
    print(reduce(lcm, t))


if __name__ == '__main__':
    main()

Solution (Python):
from math import gcd
from functools import reduce


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


def main():
    n = int(input())
    t = {int(input()) for _ in range(n)}
    print(reduce(lcm, t))


if __name__ == '__main__':
    main()

Solution (Python):
from math import gcd
from functools import reduce


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


def main():
    n = int(input())
    t = [int(input()) for _ in range(n)]
    print(reduce(lcm, t))


if __name__ == '__main__':
    main()

Solution (Python):
from math import gcd
from functools import reduce


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


def main():
    n = int(input())
    t = [int(input()) for _ in range(n)]
    print(reduce(lcm, t))


if __name__ == '__main__':
    main()

Solution (Python):
import math
N = int(input())
lsT = []
for i in range(N):
    lsT.append(int(input()))
a = lsT[0]
for b in range(1,N):
    a = a*lsT[b] // math.gcd(a,lsT[b])
print(a)

Solution (Python):
from math import gcd
n = int(input())
t = list([int(input()) for _ in range(n)])
x = 1
for i in t:
    x = x*i//gcd(x,i)
print(x)

Solution (Python):

from math import gcd
n=int(input())
t=[int(input()) for i in range(n)]

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

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

Solution (Python):


import sys



def input():
    return sys.stdin.readline().strip()


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def gcd(x: int, y: int) -> int:
    if x < y:
        x, y = y, x
    while y > 0:
        r = x % y
        x, y = y, r
    return x


def main():
    n = input_int()
    T = list(set([input_int() for _ in range(n)]))
    ans = T[0]
    for t in T[1:]:
        ans = ans * t // gcd(ans, t)
    print(ans)

    return


if __name__ == "__main__":
    main()

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

import math
from functools import reduce

print(reduce(lambda x,y : (x * y) // math.gcd(x, y), T,1))

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

N=int(input())
a=int(input())
for i in range(N-1):
    a=lcm(a,int(input()))
print(a)

Solution (Python):
from math import gcd

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

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

Solution (Python):
n=int(input())
import math
ans=1
for i in range(n):
    t=int(input())
    ans=(ans//math.gcd(ans,t))*t
    
print(ans)

Solution (Python):
from math import gcd

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

Solution (Python):
import math
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
def lcm(x, y):
    return (x * y) // gcd(x, y)

N = int(input())
T = [int(input()) for _ in range(N)]
if N == 1:
    print(T[0])
    exit()

ans = lcm(T[0] , T[1])
for i in range(2 , N):
    ans = lcm(T[i] , ans)
print(ans)

Solution (Python):
import math


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


N = int(input())
ans = int(input())
for _ in range(N - 1):
    ans = lcm(ans, int(input()))
print(ans)

Solution (Python):
import math

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

if N == 1:
    print(T[0])
elif N == 2:
    print(T[0]*T[1]//math.gcd(T[0], T[1]))
else:
    L = T[0]
    for i in range(1, N):
        L = L*T[i]//math.gcd(L, T[i])
    print(L)

Solution (Python):
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))

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

Solution (Python):
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 = [0]*n
for i in range(n):
	t[i] = int(input())
print(lcm_list(t))

Solution (Python):
n= int(input())
a=int(input())

import math
if n==1:
	print(a)
	exit()

b=int(input())
c=(a*b)//math.gcd(a,b)
for i in range(n-2):
	b=int(input())
	c=(c*b)//math.gcd(c,b)

print(c)

Solution (Python):
import math

N = int(input())

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

ans = 1

for _ in range(N):
  T = int(input())
  ans = lcm(ans, T)

print(ans)

Solution (Python):
import math
from functools import reduce

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

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

print(reduce(lcm, t))

Solution (Python):
import fractions
n=int(input())
t=[]
for _ in range(n):
    T=int(input())
    t.append(T)
ans=t[0]
for i in range(1, len(t)):
    ans = ans * t[i] // fractions.gcd(ans, t[i])
print(ans)

Solution (Python):
import math

N = int(input())
ans = int(input())
for i in range(N-1):
    t = int(input())
    ans = t*ans//math.gcd(t,ans)
print(ans)

Solution (Python):
def delete_head_zeros(n):
	n = str(n)
	l = len(n)
	if "." in n:
		l = n.find(".")
	head_zeros = 0
	for i in range(l - 1):
		if n[i] == "0":
			head_zeros += 1
		else:
			break

	return n[head_zeros:]



def bigint_compare(a, b):
	a = delete_head_zeros(a)
	b = delete_head_zeros(b)
	if len(a) > len(b):
		return 1
	elif len(a) < len(b):
		return -1
	else:
		if a > b:
			return 1
		elif a < b:
			return -1
		else:
			return 0



def bigint_plus(a, b):
	a = str(a)
	b = str(b)

	d = max([len(a), len(b)])
	a = '0' * (d - len(a)) + a
	b = '0' * (d - len(b)) + b

	ans = ""
	carry = 0
	for i in range(d):
		s = int(a[-i-1]) + int(b[-i-1]) + carry
		carry = s // 10
		ans = str(s % 10) + ans
	else:
		if carry:
			ans = str(carry) + ans

	return ans



def bigint_minus(a, b): 
	a = str(a)
	b = str(b)
	M = []
	m = []
	sign = ""

	if len(a) > len(b) or (len(a) == len(b) and a >= b):
		[M, m] = [a, b]
	else:
		[M, m] = [b, a]
		sign = "-"
	m = '0' * (len(M) - len(m)) + m

	ans = ""
	borrow = 0
	for i in range(len(M)):
		s = int(M[-i-1]) - int(m[-i-1]) - borrow
		if s < 0:
			borrow = 1
			s += 10
		else:
			borrow = 0
		ans = str(s) + ans

	return sign + delete_head_zeros(ans)



def bigint_multiply(a, b):
	a = str(a)
	b = str(b)

	md = []
	for j in range(len(b)):
		carry = 0
		mj = ""
		for i in range(len(a)):
			m = int(a[-i-1]) * int(b[-j-1]) + carry
			carry = m // 10
			mj = str(m % 10) + mj
		else:
			if carry:
				mj = str(carry) + mj
		md.append(mj)

	ans = 0
	for k in range(len(md)):
		ans = bigint_plus(md[k] + "0" * k, ans)

	return ans



def bigint_divide(a, b, d = 0):
	a = str(a)
	b = str(b)
	d = int(d)
	if d < 0:
		d = 0

	ans = ""
	r = ""
	for i in range(len(a) + d):
		q = 0
		if i < len(a):
			r += a[i]
		elif i == len(a):
			ans += "."
			r += "0"
		else:
			r += "0"

		if bigint_compare(r, b) == -1:
			ans += str(q)
		else:
			while bigint_compare(r, b) >= 0:
				r = bigint_minus(r, b)
				q += 1
			ans += str(q)

	return delete_head_zeros(ans)

def gcd(a, b):
	if bigint_compare(a, b) >= 0:
		M = a
		m = b
	else:
		M = b
		m = a
	if m == "0":
		return M
	else:
		q = bigint_divide(M, m)
		r = bigint_minus(M, bigint_multiply(m, q))
		return gcd(m, r)

def lcm(a, b):
	return bigint_divide(bigint_multiply(a, b), gcd(a, b))

def main():
	N = int(input())
	T = [input() for i in range(N)]
	ans = 1
	for i in range(len(T)):
		ans = lcm(T[i], ans)

	print(ans)

main()

Solution (Python):
N = int(input())
T = [int(input()) for _ in range(N)]
from math import gcd
def lcm(a,b):
    return a*b//(gcd(a,b))
ans = T[0]
for i in range(1, N):
    ans = lcm(ans, T[i])
print(ans)

Solution (Python):
def lcm(m, n):
    return m//gcd(m, n)*n


def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n


n = int(input())
arr = [int(input()) for _ in range(n)]
ans = 1
for i in arr:
    ans = lcm(ans, i)

print(ans)

Solution (Python):
import math

n = int(input())
a = []  
for i in range(n):
  a.append(int(input()))
if n == 1:
  print(a[0])
else:
  lcm = (a[0] * a[1]) // math.gcd(a[0], a[1])
  for i in range(2, n):
    lcm = (lcm * a[i]) // math.gcd(lcm, a[i])
  print(lcm)