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):
N = int(input())
T = []
for i in range(N):
    T.append(int(input()))
def gcd(a,b):
    if a>=b:
        if b == 0:
            return a
        else:
            return gcd(b,a%b)
    else:
        if a == 0:
            return b
        else:
            return gcd(a,b%a)
if N == 1:
    print(T[0])
elif N == 2:
    print(int(T[0]//gcd(T[0],T[1])*T[1]))
else:
    T2 = [int(T[0]//gcd(T[0],T[1])*T[1])]
    for i in range(N-2):
        nex = int(T2[i]//gcd(T2[i],T[i+2])*T[i+2])
        T2.append(nex)
    print(T2[-1])

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

Solution (Python):
import sys
import fractions
from functools import reduce
input = sys.stdin.readline
N = int(input())
T = []
for _ in range(N):
    T.append(int(input()))
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)
print(lcm_list(T))

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

def run():
  N = int(input())
  T_li = [int(input()) for n in range(N)]
  i = T_li[0]
  for T in T_li[1:]:
    i = lcm(T, i)
  print(i)
  
if __name__ == '__main__':
  run()

Solution (Python):
import sys
from functools import reduce

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

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

n, *t = map(int, sys.stdin.read().split())

def main():
    return reduce(lcm, t)

if __name__ == '__main__':
    ans = main()
    print(ans)

Solution (Python):
import fractions
N = int(input())
tx = int(input())
for _ in range(N-1):
    ty = int(input())
    tx = (tx * ty) // fractions.gcd(tx, ty)
print(tx)

Solution (Python):
import sys

def getInt():
	return int(sys.stdin.readline().rstrip())

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

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

N = getInt()

answer = 1

for i in range(N):
	answer = lcm(answer, getInt())

print(answer)

Solution (Python):
from functools import reduce, partial
from fractions import gcd
def lcm(a,b):
  return a*b//gcd(a,b)
n=int(input())
a=[int(input()) for i in range(n)]
lcmmulti = partial(reduce,lcm)
print(lcmmulti(a))

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

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

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

Solution (Python):
from fractions import gcd
def lcm(a,b):
	return (a*b) // gcd(a,b)
n = int(input())
y = 1
for i in range(n):
	x = int(input())
	y = lcm(x,y)
print (y)

Solution (Python):
import fractions
n = int(input())
a = [int(input()) for i 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 fractions
N = int(input())
T = [int(input()) for i in range(N)]
a = T[0]
for i in range(1, N):
    b = T[i]
    a = a * b // fractions.gcd(a, b)
print(a)

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

def gcd_list(nums):
    return reduce(gcd, nums)

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

def lcm_list(nums):
    return reduce(lcm, nums)

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

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

def lcm(a, b):
    return a*b // gcd(a, b)
 
n = int(input())
t = [int(input()) for i in range(n)]
 
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_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())
T=[int(input()) for i in range(n)]
def gcd(a,b):
    if b==0:
        return(a)
    else:
        return(gcd(b,a%b))
def lgm(a,b):
    return(a*b//(gcd(a,b)))
if n==1:
    print(T[0])
else:
    ans=T[0]
    for i in range(1,n):
        ans=lgm(ans,T[i])
    print(ans)

Solution (Python):
import fractions as f
n=int(input())
ans=int(input())
for i in range(n-1):
   x=int(input())
   ans=x*ans//f.gcd(ans,x)
print(ans)

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

def gcd(x,y):
    a = max(x,y)
    b = min(x,y)
    while b!=0:
        a,b = b,a%b
    return a

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

Solution (Python):

import sys, math, itertools, heapq, collections, bisect, string,fractions
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf')
mod = 10**9+7
ans = 0 ;count = 0 ;pro = 1

def lcm(m,n):
    return (m*n)//fractions.gcd(m,n)
n=int(input())
T=[int(input()) for i in range(n)]
g=1
for ti in T:
    pro=lcm(pro,ti)
print(pro)

Solution (Python):
import fractions 

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] // fractions.gcd(ans, T[i])
print(ans)

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

def gcm(a, b):
    a, b = max(a, b), min(a, b)
    if b == 0:
        return a
    else:
        return gcm(a%b, b)

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

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

Solution (Python):
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))



import fractions

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

N = one_int()

temp = one_int()
for i in range(N-1):
    temp = lcm(temp, one_int())

print(temp)

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

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

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

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

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

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

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

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

Solution (Python):
from functools import reduce
from fractions import gcd
def lcm(x, y):
    return x*y//gcd(x,y)

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

N = int(input())
A = [int(input()) for a in range(N)]
print(lcmm(A))

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
if sys.platform in (['ios','darwin','win32']):
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return [int(s) for s in input().split()]

N = INT()
A = [INT() for _ 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 = A[0]
for i in range(1, N):
	ans = ans * A[i] // gcd(ans, A[i])

print(ans)

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

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

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

Solution (Python):
def lcm(x, y):
    from fractions import gcd
    return (x * y) // gcd(x, y)


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

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

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 = 1

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

print(ans)

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

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):
  ans=lcm(ans,int(input()))
print(ans)

Solution (Python):
def gcd(x,y):
  if x>y: x,y = y,x
  while x:
    x,y = y%x, x
  return y

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

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

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

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

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

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

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

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

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):
from fractions import gcd


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


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

ans = lcm(T)

print(ans)

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

if n==1:
    print(t[0])
else:
    x=t[0]*t[1]//fractions.gcd(t[0],t[1])
    for i in range(1,n-1):
        x=x*t[i+1]//fractions.gcd(x,t[i+1])
    print(x)

Solution (Python):
import fractions
import functools

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

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

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

Solution (Python):
import fractions

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

a = T[0]
for i in range(N-1):
  a = a * T[i+1] // fractions.gcd(a, T[i+1])

print(a)

Solution (Python):
from functools import reduce

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


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


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


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


print(lcmm(t))

Solution (Python):
from functools import reduce

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


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


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


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


print(lcmm(t))

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

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

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

Solution (Python):
n = int(input())
t = [int(input()) for _ in [0]*n]

if n==1:
  print(t[0])
  exit()
  
def gcd(x, y):
	while y:
		x, y = y, x % y
	return x

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

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

Solution (Python):
N = int(input())
data = [0]*N
for i in range(0,N): data[i] = int(input())

import fractions

ans = data[0]
for i in range(0,N):
    ans = ans*data[i] // fractions.gcd(ans,data[i])

print(ans)

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


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

def a(p, q):
    if p % q == 0:
        return q
    else:
        return a(q, p % q)

f = lst[0]
for i in range(1, n):
    f = f * (lst[i] // a(f, lst[i]))

print(f)

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


if n == 1:
    print(int(input()))
else:
    lst = [int(input()) for _ in range(n)]

    def a(p, q):
        if p % q == 0:
            return q
        else:
            return a(q, p % q)

    f = lst[0] * (lst[1] // a(lst[0], lst[1]))
    for i in range(2, n):
        f = f * (lst[i] // a(f, lst[i]))
    print(f)

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

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

Solution (Python):
from fractions import gcd

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

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

n=int(input())
'''
t=[int(input()) for i in range(n)]
t.sort(reverse=1)
ans=t[0]
for x in t:
  if ans%x!=0:
    ans=ans*x//gcd(ans,x)
'''
ans=int(input())
for i in range(n-1):
  u=int(input())
  if ans%u!=0:
    ans=ans*u//gcd(ans,u)



print(ans)

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

n=int(input())
t=[int(input()) for i in range(n)]
t.sort(reverse=1)
ans=t[0]
for x in t:
  if ans%x!=0:
    ans=ans*x//gcd(ans,x)
'''
for i in range(n-1):
  u=int(input())
  if ans%u!=0:
    ans=ans*u//gcd(ans,u)
'''


print(ans)

Solution (Python):
import fractions
from functools import reduce

def lcm_2(x, y):
    return (x * y) // fractions.gcd(x, y)
    
def lcm(l):
    return reduce(lcm_2, l, 1)
    
n = int(input())
t = [int(input()) for _ in range(n)]

print(lcm(t))

Solution (Python):
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):
    x = a[0]
    for i in range(1, len(a)):
        x = x * a[i] // gcd(x, a[i])
    return x

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

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

Solution (Python):
def gmax(a,b):
  if a<b:
  	a,b=b,a
  while a%b!=0:
    tmp=a
    a=b
    b=tmp%b
  return b
 
n=int(input())
x=[]
for i in range(n):
  x.append(int(input()))

if len(x)!=1:
  g=gmax(x[0],x[1])
  l=x[0]*x[1]//g

  for i in range(2,len(x)):
    g=gmax(x[i],l)
    l=(x[i]*l)//g
else:
  l=x[0]
print(l)

Solution (Python):
import fractions

def lcm(a, b):
    return a * b // fractions.gcd (a, b)
  
n = int(input())
t = sorted([int(input()) for _ in range(n)])
ans = t[0]
for i in range(1, n):
    ans = lcm(ans,t[i])
print(ans)

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

Solution (Python):
import fractions

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

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

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

print(ans)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect_left
from heapq import heappush, heappop
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import floyd_warshall

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
T = [INT() 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):
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())
a=[int(input()) for _ in range(n)]
ans=a[0]
from fractions import gcd
for i in range(1, n):
    ans = ans * a[i] // gcd(ans, a[i])
print(ans)

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)

n = int(input())
L = [ int(input()) for _ in range(n) ]
print(lcm(L))

Solution (Python):
import fractions

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

    if not (1 <= n and n <= 100 and isinstance(n, int)):
        return
    for i in t:
        if not (1 <= i and i <= 10**18 and isinstance(i, int)):
            return

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

    if k <= 10**18:
        print(k)

if __name__ == "__main__":
    main()

Solution (Python):
import fractions
from functools import reduce

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

def lcm_rec(num):
    return reduce(lcm, num, 1)

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

ans = lcm_rec(T)
print(ans)

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

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

Solution (Python):

from fractions import gcd
from functools import reduce
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

n = int(input())


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


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


def gcds(*numbers):
    return reduce(gcd, numbers)


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

Solution (Python):
N=int(input())
T=[0]*N
for i in range(N):
  T[i]=int(input())
  
def gcd(a,b):
  if b>a:
    a,b=b,a
  while a%b!=0:
    a,b=b,a%b
  return b

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

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

Solution (Python):
from fractions import gcd
n = int(input())
for i in range(n):
    t = int(input())
    if i == 0:
        l = t
        k = t
    else:
        l = gcd(k, t)
        k = k * t//l
print(k)

Solution (Python):
import fractions

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

for i in range(1, N):
    q = fractions.gcd(T[i-1], T[i])
    T[i] = T[i-1]*T[i]//q
    
print(T[N-1])

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

ans = lcm(num)

print(ans)

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

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

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

n = int(input())
if n==1:
  print(int(input()))
  sys.exit()

t = [int(input()) for _ in range(n)]
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)//gcdc(a, b)

n = int(input())
l = []
for i in range(n):
	l.append(int(input()))
t = l[0]
for i in range(1, n):
	t = (t*l[i])//gcd(t, l[i])
print(t)

Solution (Python):
from sys import stdin
from itertools import groupby

n = int(stdin.readline().rstrip())
li = [int(stdin.readline().rstrip()) for _ in range(n)]

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


point = li[0]
for i in range(n-1):
    point = lcm(point,li[i+1])

print(point)

Solution (Python):
from fractions import gcd
 
N = int(input())
T = [int(input()) for i in range(N)]
answer = T[0]
 
for i in range(N):
    answer = (answer*T[i]) // gcd(answer,T[i])
 
print(answer)

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

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

Solution (Python):
import fractions as f
n=int(input())
t=int(input())
ans=0
if n==1:
    print(t)
else:
    for i in range(n-1):
        s=int(input())
        t=s*t//f.gcd(t,s)
        if ans<t:
            ans=t
        
    print(ans)

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

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline


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(readline())
    T = list(map(int, read().split()))
    print(lcm(*T))


main()

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

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

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

ans = 1

for t_i in T:
  ans = lcm(ans, t_i)
  
print(ans)

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

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

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

ans = reduce(lcm, l)
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:list):
  return reduce(lcm_base,numbers,1)

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

print(lcm(T))

Solution (Python):
import fractions
N = int(input())
tokei = [int(input()) for _ in range(N)]
if N == 1:
    print(tokei[0])
    exit()
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
ans = lcm(tokei[0],tokei[1])
for i in range(2,N):
    ans = lcm(ans,tokei[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())
ans = 1
for _ in range(N):
    ans = lcm(ans, int(input()))

print(ans)

Solution (Python):
import fractions

n = int(input())

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

print(ans)

Solution (Python):
N=int(input())
T=[]
for i in range(N):
    t=int(input())
    T.append(t)
    
ans=T[0]
def LCM(a,b):
    A=max(a,b)
    B=min(a,b)
    while A%B!=0:
        A,B=B,A%B
    
    return a*b//B

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

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

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


def examC():
    N = I()
    T = [I() for _ in range(N)]
    ans = 1
    for t in T:
        ans = lcm(ans, t)
    print(ans)

import sys
import copy
import bisect
import heapq
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examC()

Solution (Python):
from fractions import gcd
n=int(input())
T=[]
for i in range(n):
    t=int(input())
    T.append(t)
if n==1:
    print(T[0])
else:
    ts=T[0]*T[1]//gcd(T[0],T[1])
    for i in range(n-2):
        ts=ts*T[i+2]//gcd(ts,T[i+2])
    print(ts)

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

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



print(lcm_list(A))

Solution (Python):

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

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


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

print(temp)

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

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

print(lcm(*L))

Solution (Python):
from fractions import gcd  
n = int(input())
t = sorted([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):
import fractions
n = int(input())
t = [int(input()) for _ in range(n)]

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

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

Solution (Python):
import sys
import math

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

N = int(input())
T = [int(input()) for _ in range(N)]
if N == 1:
	print(T[0])
	sys.exit()
def SKS(a,b):
	return (a*b)//GCD(a,b)

for i in range(1,N):
	if i == 1:
		temp = SKS(T[0], T[1])
		continue

	temp = SKS(temp, T[i])

print(temp)

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

num = int(input())
for i in range(num):
  x = int(input())
  if i == 0:
    y = x
  else:
    y = lcm(x, y)
print(y)

Solution (Python):

from fractions import gcd
import math

from math import factorial as f

from math import ceil,floor,sqrt

from sys import exit

from copy import deepcopy
import numpy as np

import bisect
import re
import heapq


ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))



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

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

main()

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


def lcm(a):
    from fractions import gcd
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x


print(lcm(Tlist))

Solution (Python):
from fractions import gcd

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):
from fractions import gcd


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


N = int(input())

result = 1
for _ in range(N):
    T = int(input())
    result = lcm(result, T)
print(result)

Solution (Python):
import fractions
from functools import reduce

n = int(input())

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

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

Solution (Python):
def lcm(c):
    from fractions import gcd
    x = c[0]
    for i in range(1,len(c)):
        x = (x * c[i]) // gcd(x,c[i])
    return x
    
N = int(input())
a = [int(input()) for i in range(N)]
print(lcm(a))

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

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

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

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


if __name__ == '__main__':
    main()

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

def lcm(x, y):
	return (x * y) // gcd(x, y)
a = 1
for i in t:
	a = lcm(a, i)
print (a)

Solution (Python):
def gcd(x, y):
    if x > y:
        y, x = x, y
    if x == 0:
        return y
    return gcd(y % x, x)
 
 
def lcm(x, y):
    d = gcd(x, y)
    return x * y // d
 
 
N = int(input())
 
ans = 1
for _ in range(N):
    a = int(input())
    ans = lcm(ans, a)
print(ans)

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

Solution (Python):
import fractions
from functools import reduce

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

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

N = int(input())
times = [int(input()) for _ in range(N)]
print(lcm(times))

Solution (Python):
from fractions import gcd
def lcm(a):
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x
  
n=int(input())

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

print(lcm(t))

Solution (Python):
def main():
    N = int(input())
    T = []
    for i in range(N):
        T.append(int(input()))
    
    def lcm(a):
        from fractions import gcd
        x = a[0]
        for i in range(1, len(a)):
            x = (x * a[i]) // gcd(x, a[i])
        return x

    r = lcm(T)
    print(r)



if __name__ == "__main__":
    main()

Solution (Python):

from functools import reduce
import math
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_set = set()

for _ in range(N):
    t = int(input())
    T_set.add(t)
    
T_list = list(T_set)
print(lcm_list(T_list))

Solution (Python):
from sys import stdin

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, *t = map(int, stdin.read().split())

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

print(a)

Solution (Python):
from fractions import gcd

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):
from functools import reduce
import math
import fractions
N = int(input())
T_list = [ int(input()) for i in range(N)  ]
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_list) )

Solution (Python):
import fractions
def lcm_list(List):
    ans=List[0]
    for i in range(1,len(List)):
        ans=ans*List[i] // fractions.gcd(ans,List[i])
    return(ans)

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

print(lcm_list(T))