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):
def gcd (a,b):
    if b == 0:
        return a
    return gcd(b , a % b)

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

from functools import reduce

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

print(reduce(lcm,t))

Solution (Python):
from fractions import gcd
N=int(input())
T=1
for i in range(N):
    T1=int(input())
    t=gcd(T,T1)
    T=(T1//t)*(T//t)*t
print(T)

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

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

_, *t = map(int, open(0).read().split())
print(reduce(lcm, t))

Solution (Python):
import fractions
from functools import reduce

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)

def main():
    N = int(input())
    li = []
    for i in range(N):
        li.append(int(input()))
    
    print(lcm_list(li))

main()

Solution (Python):
N = int(input())
ans = int(input())

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

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

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

print(ans)

Solution (Python):
n = int(input())
result = 1
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

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

for _ in range(n):
    num = int(input())
    result = lcm(num, result)
print(result)

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

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

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

print(l)

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


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

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
  
N = int(input())
T = [int(input()) for _ in range(N)]

ans = lcm_list(T)
print(ans)

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

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

g = 1
for x in (int(input()) for _ in range(N)):
  g = g * x // gcd(g, x)
print(g)

Solution (Python):
def min_mult(a, b):
    result = max(a, b)
    while result % min(a, b) != 0:
        result += max(a, b)
    return result
N = int(input())
multiple = 1
for _ in range(N):
    multiple = min_mult(multiple, int(input()))
print(multiple)

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

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


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


n = int(input())
print(lcm(*tuple(int(input()) for i in range(n))))

Solution (Python):
from fractions import gcd
def lcm(a,b):
  return (a*b)//gcd(a,b)

def main():
  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)
  
if __name__=="__main__":
  main()

Solution (Python):
from fractions import gcd


n = int(input())
li_t = list()

for _ in range(n):
    li_t.append(int(input()))




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

work = 1

for t in li_t:
    work = lcm(work, t)

print(work)

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

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

a = 1

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

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

print(a)

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

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

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

print(ans)

Solution (Python):
from fractions import gcd
from functools import reduce
N = int(input())
T = [int(input()) for _ in range(N)]


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

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


ans = 1
for t in lst_T:
    ans = lcm(ans, t)


print(ans)

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


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


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


ans = reduce(lcm, lst_T)


print(ans)

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 * b) // g


N = int(input())
lst_T = [int(input()) for _ in range(N)]
ans = 1


for t in lst_T:
    ans = lcm(ans, t)


print(ans)

Solution (Python):


import math




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


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

Solution (Python):

"""解説

(例)
T0 = 2
T1 = 3

直感的に、最小公倍数が答え。
よって6。
"""
from fractions import gcd
from functools import reduce


def lcm(a, b):
    """ aとbの最小公倍数を返す """
    return a*b // gcd(a, b)

def solve():
    N = int(input())
    T = []
    for i in range(N):
        T.append(int(input()))
    ans = reduce(lcm, T)
    print(ans)


if __name__ == "__main__":
    solve()

Solution (Python):

"""

(例)
T0 = 2
T1 = 3

最小公倍数が答え。
よって6。
"""
from fractions import gcd
from functools import reduce


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

def solve():
    N = int(input())
    T = []
    for i in range(N):
        T.append(int(input()))
    ans = reduce(lcm, T)
    print(ans)


if __name__ == "__main__":
    solve()

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


n = int(input())
ans = 1
l = [int(input()) for i in range(n)]

for i in l:
    ans = ans*i//gcd(ans,i)
print(ans)

Solution (Python):
import sys
import bisect
input = sys.stdin.readline

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

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

t = L[0]
for i in range(1, N):
    p = gcd(t, L[i])
    t = t * L[i] // p
    
print(t)

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

n=int(input())
s=int(input())
for _ in range(n-1):
  tmp=int(input())
  s=(s*tmp)//gcd(s,tmp)
print(s)

Solution (Python):
from functools import reduce
N = int(input())
T = [0]*N
for i in range(N):
    T[i] = int(input())
def gcd(x, y):
    while y > 0:
        x, y = y, x % y
    return x
def lcm(x, y):
    return x*y//gcd(x, y)
print(reduce(lcm, T))

Solution (Python):
from functools import reduce
def gcd(x, y):
	while y > 0:
		x, y = y, x % y
	return x
def lcm(x, y):
	return x * y // gcd(x, y)
print(reduce(lcm, [int(input()) for _ in range(int(input()))]))

Solution (Python):
def gcd(x,y):
    while not y == 0:
        x,y = y,x%y
    return x

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

N = int(input())
T = list(int(input())for i in range(N))
tmp =1
for i in T:
    tmp =lcm(tmp,i)
print(tmp)

Solution (Python):
def gcd(x, y):
    while y != 0:
        x, y = y, x % y
    return x


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


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

print(ans)

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


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


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

print(ans)

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

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

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

p=t[0]
for k in range(1,n):
    p=lcm(p,t[k])

print(p)

Solution (Python):

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

Solution (Python):
from fractions import gcd

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

Solution (Python):
from fractions import gcd

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

Solution (Python):
from fractions import gcd

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

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

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

print(ans)

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


def lcm(num1, num2):
  return num1 * num2 // gcd(num1, num2)


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

print(reduce(lcm, a))

Solution (Python):
N = int(input())
T = [int(input()) for _ in range(N)]
def gcd(x,y):
    return x if y == 0 else gcd(y,x%y)
ans = T[0]
for t in T:
    ans = ans * t // gcd(ans,t)
print(ans)

Solution (Python):
def lcm(n,m):
  while m!=0:
    n,m=m,n%m
  return n
def gcd(n,m):
  return n*m//lcm(n,m)
n=int(input())
c=int(input())
for i in range(n-1):
  c1=int(input())
  c=gcd(c,c1)
print(c)

Solution (Python):
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy
import collections
from operator import itemgetter

def j(q):
    if q==1: print("Yes")
    else:print("No")
    exit(0)


def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")

def ip():
    return int(input())
def printrow(a):
    for i in range(len(a)):
        print(a[i])
def combinations(n,r):
    if n<r:return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def permutations(n,r):
    if n<r:return 0
    return math.factorial(n) // math.factorial(n - r)
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)





n = ip()                      
a=[ip() for i in range(n)]    




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

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

from fractions import gcd
from functools import reduce

print(reduce(lambda a, b : a * b // gcd(a, b), T))

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

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

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

x = T[0]
for i in range(N-1):
    x = lcm(x, T[i+1])

print(x)

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

def gcd(n,m):
    while n > 0:
        a = n
        n = m % n
        m = a
    return m

a = 1

for t in T:
    a = a * t // gcd(a,t)

print(a)

Solution (Python):

input_int = lambda:int(input())
input_ints = lambda:map(int,input().split())
input_str = lambda:input()
input_strs = lambda:input().split()
input_lines = lambda n,f:[f() for _ in range(n)]

import functools,fractions
import numpy as np
gcd = lambda a:functools.reduce(fractions.gcd,a) 
lcm_base = lambda a,b:(a*b)//fractions.gcd(a,b) 
lcm = lambda a:functools.reduce(lcm_base,a,1) 

def solution():
    N = input_int()
    Ts = input_lines(N,input_int)

    ans = lcm(Ts)
    print(ans)

if __name__ == '__main__':
    solution()

Solution (Python):
import fractions

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


ans=x[0]
for j in range(1,len(x)):
    ans=ans*x[j]// fractions.gcd(ans,x[j])

print(ans)

Solution (Python):


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

    return n, tlist


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


def mylcm(a, b):
    g = mygcd(a, b)
    return a * b // g


def submit():
    n, tlist = read_input()

    acc = 1
    for t in tlist:
        acc = mylcm(acc, t)

    print(acc)


if __name__ == '__main__':
    submit()

Solution (Python):
from collections import Counter
from functools import reduce

import bisect
import copy
import fractions
import math
import pprint
import random
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def MI(): return map(int, sys.stdin.readline().split())
def II(): return int(sys.stdin.readline())
def IS(): return input()
def C(x): return Counter(x)
def GCD_LIST(numbers):
    return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers):
    return reduce(LCM, numbers)
def LCM(m, n):
    return (m * n // fractions.gcd(m, n))
def unite(x, y):
    
    x = root(x)
    y = root(y)
    if x == y:
        return
    
    node[x] = y
def same(x,y): return bool(root(x) == root(y))
def root(x):
    if node[x] == x:  
        return x
    else:
        node[x] = root(node[x])  
        return node[x]
def dfs(v):
    
    visited[v] = True
    for v2 in range(n):
        if graph[v][v2] == False:  
            continue
        if visited[v2] == True:  
            continue
        dfs(v2)

n = II()
t = [II() for _ in range(n)]
print(LCM_LIST(t))

Solution (Python):
import fractions

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

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

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

print(X)

Solution (Python):
import fractions
N = int(input())
T_before =int(input())

for i in range(1,N):
    T =int(input())
    f=fractions.gcd(T,T_before)
    T_before=T*T_before//f
    
print(T_before)

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)

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


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

if N==1:
	print(T[0])
else:
	print(lcm_list(T))

Solution (Python):

input_int = lambda:int(input())
input_ints = lambda:map(int,input().split())
input_str = lambda:input()
input_strs = lambda:input().split()
input_lines = lambda n,f:[f() for _ in range(n)]

import functools,fractions
import numpy as np
gcd = lambda a:functools.reduce(fractions.gcd,a) 
lcm_base = lambda a,b:(a*b)//fractions.gcd(a,b) 
lcm = lambda a:functools.reduce(lcm_base,a,1) 

def solution():
    N = input_int()
    Ts = input_lines(N,input_int)

    ans = lcm(Ts)
    print(ans)

if __name__ == '__main__':
    solution()

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

def gcd_l(A):
    if len(A) == 1:
        return A[0]
    x = gcd(A[0], A[1])
    if len(A) == 2:
        return x
    for i in range(2, len(A)):
        x = gcd(x, A[i])
    return x

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

def lcm_l(A):
    A.sort()
    if len(A) == 1:
        return A[0]
    x = lcm(A[0], A[1])
    if len(A) == 2:
        return x
    for i in range(2, len(A)):
        x = lcm(x, A[i])
    return x


N = int(input())
T = [int(input()) for _ in range(N)]
T = list(set(T))
T.sort()
N = len(T)
L = []
'''
for i in range(N):
    flag = 1
    for j in range(N-1, i, -1):
        if T[j] % T[i] == 0:
            flag = 0
            break
    if flag:
        L.append(T[i])

GCD = gcd_l(L)
ans = 1
for i in range(len(L)):
    ans *= L[i] // GCD
ans *= GCD
if len(L) == 1:
    ans = L[0]
'''
ans = lcm_l(T)
print(ans)

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

def gcd_l(A):
    if len(A) == 1:
        return A[0]
    x = gcd(A[0], A[1])
    if len(A) == 2:
        return x
    for i in range(2, len(A)):
        x = gcd(x, A[i])
    return x

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

def lcm_l(A):
    if len(A) == 1:
        return A[0]
    x = lcm(A[0], A[1])
    if len(A) == 2:
        return x
    for i in range(2, len(A)):
        x = lcm(x, A[i])
    return x


N = int(input())
T = [int(input()) for _ in range(N)]
T = list(set(T))
T.sort()
N = len(T)
L = []
'''
for i in range(N):
    flag = 1
    for j in range(N-1, i, -1):
        if T[j] % T[i] == 0:
            flag = 0
            break
    if flag:
        L.append(T[i])

GCD = gcd_l(L)
ans = 1
for i in range(len(L)):
    ans *= L[i] // GCD
ans *= GCD
if len(L) == 1:
    ans = L[0]
'''
ans = lcm_l(T)
print(ans)

Solution (Python):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

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


def solve():
    n = f()[0]
    a = []
    for i in range(n):
        a.append(f()[0])

    lcm = a[0]

    for i in range(1,n):
        lcm = lcm*a[i]//gcd(lcm, a[i])

    print(lcm)


solve()

Solution (Python):
from fractions import gcd

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

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

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=[int(input()) for _ in range(N)]
ans=1
for i in T:
    ans=lcm(i,ans)
print(ans)

Solution (Python):
from functools import reduce
import fractions

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

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

    
    
    
    
    
    

    
    

    
    
    
    
    
    
    
    
    
    INF = float("inf")

    
    MOD = 10**9+7
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    N = int(input().rstrip())
    T = []
    for i in range(N):
        T.append(int(input().rstrip()))    
    print(lcm_list(T))
    
if __name__ == '__main__':
    main()

Solution (Python):
def gcd(a, b):
  v0 = a
  v1 = b
  v2 = a % b
  while v2 > 0:
    v0 = v1
    v1 = v2
    v2 = v0 %v1
  return v1

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

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

Solution (Python):
import fractions
from functools import reduce

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

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

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

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


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

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


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

print(ans)

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


def gcd(a, b):
    tmp_a, tmp_b = a, b
    a = max(tmp_a, tmp_b)
    b = min(tmp_a, tmp_b)
    r = a % b
    while r > 0:
        a = b
        b = r
        r = a % b
    return b
    

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


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

print(ans)

Solution (Python):
from fractions import gcd

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

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

Solution (Python):
from functools import reduce

def gcd(x, y):
    if x >= y:
        while y != 0:
            x, y = y, x % y
        return x
    else:
        while x != 0:
            y, x = x, y % x
        return y


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


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

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

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

print(lcm(*l))

Solution (Python):
from functools import reduce

def gcd(x, y):
    if x >= y:
        while y != 0:
            x, y = y, x % y
        return x
    else:
        while x != 0:
            y, x = x, y % x
        return y
        

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


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

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

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

print(lcm(*l))

Solution (Python):

import copy
import random
import bisect 
import fractions

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


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

ans = 1
for t in T:
    ans = lcm(ans,t)

print(ans)

Solution (Python):
import fractions


def lcm(a, b):
    n = fractions.gcd(a, b)
    return a * b // n if n > 0 else 0


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

Solution (Python):
from functools import reduce
from fractions import gcd
n = int(input())
t = []
for i in range(n):
    t.append(int(input()))
print(reduce(lambda x, y: x * y // gcd(x, y), t))

Solution (Python):
from fractions import gcd

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

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

if N == 1:
    print(T[0])
    exit()

ans = f(T[0], T[1])

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

print(ans)

Solution (Python):
from functools import*
from fractions import*
n,*t=map(int,open(0).read().split())
def ggcd(a,b):
    return a*b//gcd(a,b)
print(reduce(ggcd,t))

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

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

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

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

Solution (Python):
import functools

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

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

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

def lcm_list(*x):
  return functools.reduce(lcm, x)

print(lcm_list(*t))

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

def lcm_list(num):
    return reduce(lcm_base,num,1)
print(lcm_list(t))

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

Solution (Python):
n=int(input())
def gcd(m,n):
  if m<n:
    return gcd(n,m)
  if m%n==0:
    return n
  else:
    return gcd(n,m%n)
ans=int(input())
for i in range(n-1):
  t=int(input())
  d=gcd(ans,t)
  ans*=t//d
print(ans)

Solution (Python):
import fractions
n=int(input())
a=[]
for i in range(n):a.append(int(input()))
while len(a)>1:
    j=a.pop()
    k=a.pop()
    a.append(j*k//fractions.gcd(j,k))
print(a[0])

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

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

def GCD(a,b):
    x3 = a % b
    if x3 == 0:
        return min(a,b)
    N = GCD(b,x3)
    return N

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(int(ans))

Solution (Python):
a=int(input())
li = [int(input()) for i in range(a)]
li.sort()

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


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

ans=li[0]
for i in range(a-1):
  if ans<=li[i+1]:
    ans=lcm(ans,li[i+1])
  else:
    ans=lcm(li[i+1],ans)

print(int(ans))

Solution (Python):
def gcd(a,b):
    if b<a:
        x=b 
        y=a
    else:
        x=a
        y=b
    
    while x%y!=0:
        newy=x%y
        x=y
        y=newy
    return y
def lcm(a,b):
    return(a*b//gcd(a,b))
N=int(input())
curlcm=1
for _ in range(N):
    curlcm=lcm(curlcm,int(input()))
print(curlcm)

Solution (Python):
import functools

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





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


def LCM( a, b ):
    return a*b // GCD(a,b)


ans = functools.reduce( LCM, T ) 
print( ans )

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





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


def LCM( a, b ):
    return a*b // GCD(a,b)


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

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

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

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

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

Solution (Python):
import fractions
from functools import reduce

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

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

result_lcm = reduce(lcm_base, t)
print(result_lcm)

Solution (Python):
import fractions
from functools import reduce
 
def lcm_base(x, y):
  return (x*y)//fractions.gcd(x, y)
 
def lcm_list(numbers):
  return reduce(lcm_base, numbers, 1)
 
n = int(input())
ts = [0]*n
for i in range(n):
  ts[i] = int(input())

print(lcm_list(ts))

Solution (Python):
import sys
import fractions
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())

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

n = ni()
t = ni()
if n == 1:
    print(t)
else:
    for i in range(n - 1):
        tmp = ni()
        t = lcm(t, tmp)
    print(t)

Solution (Python):
from functools import reduce

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())
nums = [int(input()) for _ in range(n)]
print(reduce(lcm, nums))

Solution (Python):
def gcd(x,y):
    if y==0:
        return x
    return gcd(y,x%y)
n = int(input())
res = 1
for _ in range(n):
    curr = int(input())
    res = (res*curr)//gcd(res,curr)
print(res)

Solution (Python):

from fractions import gcd
from functools import reduce

N = int(input())
T = map(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):
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


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


def list_lcm(number_list):
    lcm_number = 1
    for j in range(len(number_list)):
        lcm_number = lcm(lcm_number, number_list[j])

    return lcm_number


if __name__ == '__main__':
    number_count = int(input())
    numbers = []
    for i in range(number_count):
        numbers.append(int(input()))
    print(int(list_lcm(numbers)))

Solution (Python):
import fractions


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


def list_lcm(number_list):
    lcm_number = 1
    for j in range(len(number_list)):
        lcm_number = lcm(lcm_number, number_list[j])

    return lcm_number


if __name__ == '__main__':
    number_count = int(input())
    numbers = []
    for i in range(number_count):
        numbers.append(int(input()))
    print(int(list_lcm(numbers)))

Solution (Python):
import fractions
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] // fractions.gcd(ans, t[i])
print(ans)

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

Solution (Python):
n=int(input())
t=[int(input()) for _ in range(n)]
from fractions import gcd
from functools import reduce
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):
N = int(input())
def gcd(a,b):
  while(b>0):
    a,b = b,a%b
  return a

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

for i in range(N): 
  t = int(input())
  if(i == 0): ans = t
  else: ans= lcm(ans,t)
print(ans)

Solution (Python):
N=int(input())
def gcd(a,b):
    while b:
        a,b=b,a%b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)

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

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

Solution (Python):
n=int(input())
def gcd(a,b):
  while b:a,b=b,a%b
  return a
def lcm(a,b):return a*b//gcd(a,b)
ans=int(input())
for i in range(n-1):
  a=int(input())
  ans=lcm(ans,a)
print(ans)

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

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

from functools import reduce
print(reduce(lcm, Tn, 1))

Solution (Python):
import fractions
from functools import reduce
n = int(input())
t = [int(input()) for _ in range(n)]

def gcd(numbers):
  return reduce(fractions.gcd, numbers)

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

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

print(lcm(t))

Solution (Python):
from fractions import gcd
from functools import reduce
n=int(input())
l=[int(input()) for i in range(n)]
def lcm(x,y):
  return x*y//gcd(x,y)
def lcm_list(numbers):
  return reduce(lcm,numbers,1)
ans=lcm_list(l)
print(ans)

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

n=int(input())

x=1
for i in range(n):
    c=int(input())
    x=c*x//gcd(c,x)
print(x)

Solution (Python):
N = int(input())
R = list(int(input())for _ in range(N))
def gcd(a,b):
        if a < b:
            c = b
            b = a
            a = c
        while b != 0:
            c = a % b
            a = b
            b = c
        return a
def lcm(a,b):
    c = a*b//gcd(a,b)
    return c
p = R[0]
for i in range(N):
    p = lcm(p,R[i])
print(p)

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

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

import sys
input = sys.stdin.readline
N = int(input())
if N == 1:
    print(input())
else:
    T = [int(input()) for _ in range(N)]
    ans = lcm(T[0], T[1])
    for i in range(2, N):
        ans = lcm(ans, T[i])
    print(ans)

Solution (Python):
n = int(input())
t = [int(input()) for _ in range(n)]
def f(a,b):
    if b==0:
        return a
    else:
        return f(b,a%b)
t = sorted(t)[::-1]
l = t[0]
for i in range(1,len(t)):
    gcd = f(l,t[i])
    l = l*t[i]//gcd
print(l)

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


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


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


ans = 1
for t in T:
    ans = lcm(ans, t)

print(ans)