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):
import fractions
N = int(input())

a = []
for _ in range(N):
    t = int(input())
    a.append(t)
ans = a[0]
for i in range(1, N):
    ans = ans * a[i] // fractions.gcd(ans, a[i])

print(ans)

Solution (Python):
from fractions import gcd
import io

data = int(input())
ans = 1
for _ in range(data):
  t = int(input())
  ans = t * ans // gcd(t, ans)
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())
ans = 1
for i in range(n):
    a = int(input())
    ans = lcm(ans,a)
print(ans)

Solution (Python):
import fractions

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

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

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

print(ans)

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

def lcm_base(x, y):
    return (x * y) // gcd(x, y)
def lcm_list(nums):
    return reduce(lcm_base, nums, 1)

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

if __name__ == '__main__':
    main()

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)
	
def lcm_n(num):
	value = num[0]
	for item in num[1:]:
		value = lcm(value, item)
	return value

n = int(input())
t_list = [int(input()) for i in range(n)]
t_list = list(set(t_list))
targets = []
for t in t_list:
	flag = True
	for t2 in t_list:
		if t != t2 and t2 % t == 0:
			flag = False
			break
	if flag:
		targets.append(t)
print(lcm_n(targets))

Solution (Python):
import numpy as np
n=int(input())
a = list( int(input()) for _ in range(n))

ans = 1
from fractions import gcd
for ai in a:
    ans = ans*ai//gcd(ans,ai)
print(ans)

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

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)


print(lcm_list(t))

Solution (Python):













mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    from fractions import gcd
    n = int(input())
    ans = 1
    for i in range(n):
        t = int(input())
        ans = ans * t // gcd(ans,t)
    print(ans)
if __name__ == '__main__':
  main()

Solution (Python):
from fractions import gcd
from functools import reduce
import sys
input = sys.stdin.readline

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

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

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

if __name__ == '__main__':
    main()

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

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


import functools
def lcmn(nums):
        return functools.reduce(lcm, nums)
print(lcmn(t))

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

import fractions

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

print(ans)

Solution (Python):
def gcd(x, y):
  while(x % y != 0 and y % x != 0):
    if(x > y):
      x = x % y
    else:
      y = y % x
  if(x > y):
    return y
  else:
    return x
  
N = int(input())
A = list()
for i in range(N):
  A.append(int(input()))

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


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

print(lcm(*T))

Solution (Python):
import fractions

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

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

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 collections import deque
from heapq import heapify,heappop,heappush,heappushpop
from copy import copy,deepcopy
from itertools import permutations,combinations
from collections import defaultdict,Counter

from fractions import gcd
from functools import reduce
from pprint import pprint

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

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

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

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

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

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

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


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

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

ans = lcm_list(t)
print(ans)

Solution (Python):
def gcd(a,b):
    return gcd(b,a % b) if b else abs(a)
def lcm(a,b):
    return (a*b) // gcd(a,b)
n = int(input())
t = []
for i in range(n):
    a = int(input())
    t.append(a)
b = t[0]
for i in range(1,n):
    b = lcm(b,t[i])
print(b)

Solution (Python):


import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

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

    from functools import reduce
    from fractions import gcd

    def lcm(A, B):
        return A * B // gcd(A, B)

    print(reduce(lcm, T))


resolve()

Solution (Python):
import sys
import fractions

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

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

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

print(start)

Solution (Python):
from fractions import gcd
from functools import reduce
n, *T = map(int, open(0).read().split())
print(reduce(lambda x, y:x*y//gcd(x, y), T))

Solution (Python):
n = int(input())
t = [int(input())for _ in range(n)]
def gcd(x,y):
    if x%y == 0:return y
    return gcd(y%x,x)
def lcm(x,y):
    return (x*y)//gcd(x,y)

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

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

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

Solution (Python):
from fractions import gcd
from functools import reduce
n = int(input())
l = list(int(input()) for _ in range(n))
 
def lcm_base(x,y):
  return x*y//gcd(x,y)
 
def lcm_list(t):
  return reduce(lcm_base,t)
  
print(int(lcm_list(l)))

Solution (Python):
from fractions import gcd
n = int(input())

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

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

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

Solution (Python):


int1 = lambda x: int(x) - 1
def II(): return int(input())

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

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

import fractions as math

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

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

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


if __name__ == '__main__':
    solve()

Solution (Python):
from fractions import gcd


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


if __name__ == "__main__":
    n = int(input())
    t = list()
    for i in range(n):
        t.append(int(input()))

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

    print(ans)

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

Solution (Python):
import fractions

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

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

Solution (Python):
import sys

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

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

def main():
    res = 1
    for x in t:
        res = lcm(res, x)
    print(res)

if __name__ ==  '__main__':
    main()

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

print(S_t)

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)

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

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

print(lcm_list(list_T))

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

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

ans = ts[0]
for i in range(1, n):
    ans = ans * ts[i] // fractions.gcd(ans, ts[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(N):
  a=a*T[i]//fractions.gcd(a,T[i])
print(a)

Solution (Python):
import fractions
def sks(a,b):
    return (a*b)//fractions.gcd(a,b)
c=int(input())
result=1
for a in range(c):
    result=sks(result,int(input()))
print(result)

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 = list(int(input()) for _ in range(n))

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

Solution (Python):










"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""

""" n! mod m 階乗
mod = 1e9 + 7
N = 10000000
fac = [0] * N
def ini():
  fac[0] = 1 % mod
  for i in range(1,N):
    fac[i] = fac[i-1] * i % mod"""

"""mod = 1e9+7
N = 10000000
pw = [0] * N
def ini(c):
  pw[0] = 1 % mod
  for i in range(1,N):
    pw[i] = pw[i-1] * c % mod"""

"""
def YEILD():
  yield 'one'
  yield 'two'
  yield 'three'
generator = YEILD()
print(next(generator))
print(next(generator))
print(next(generator))
"""
"""def gcd_(a,b):
  if b == 0:
    return a
  return gcd_(a,a % b) 
"""def extgcd(a,b,x,y):
  d = a
  if b!=0:
    d = extgcd(b,a%b,y,x)
    y -= (a//b) * x
    print(x,y)
  else:
    x = 1
    y = 0
  return d"""


def readInts():
  return list(map(int,input().split()))
mod = 10**9 + 7
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
def main():
  n = int(input())
  ans = 1
  for i in range(n):
    t = int(input())
    ans = lcm(ans,t)
  print(ans)
  
if __name__ == '__main__':
  main()

Solution (Python):
n = int(input())
tn = [None] * n
for i in range(n):
    tn[i] = (int(input()))

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

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


result = 1
for t in tn:
    result = lcm(result, t)
2

print(result)

Solution (Python):
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

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 I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()


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



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


def main():
  n=I()
  ans=1
  for _ in range(n):
    ans=lcm(ans,I())

  return ans


print(main())

Solution (Python):
import numpy as np
from fractions import gcd

def lcm(x, y):
    return (x*y) // gcd(x, y)
ufunc = np.frompyfunc(lcm,2,1)

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

ans = ufunc.reduce(t)
print(ans)

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

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


def gcd(a, b):
    while b!=0:
        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
n,*t=map(int,open(0).read().split())
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 = sorted([int(input()) for _ in range(n)],reverse = True)
def c_mul(x,y):
  d = x
  e = y
  while y%x != 0:
    z = y%x
    y = x
    x = z
  else:
    return d*e//x
for i in range(1,n):
  a = c_mul(t[0],t[i])
  if a != t[0]:
    t[0] = a
print(t[0])

Solution (Python):
import sys
from io import StringIO
import unittest
import fractions
import math
from functools import reduce

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


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


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

    print(lcm_list(t))


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)

if __name__ == "__main__":
    
    resolve()

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

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

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

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

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

Solution (Python):
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from fractions import gcd
from math import factorial, sqrt
from functools import lru_cache, reduce
INF = 1 << 60
mod = 1000000007
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline


class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


def dijkstra_heap(s, edge, n):
    
    d = [10**20] * n
    used = [True] * n 
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


def lcm_base(x, y):
    return (x * y) // 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())
ans = lcm(*t)
print(ans)

Solution (Python):
N = int(input())
T = [int(input()) for i in range(N)]
def gcd(x,y):
    if x<y:x,y = y,x
    if y==0:return x
    return gcd(y,x%y)
S = T[0]
for i in range(1,N):
    S = S*T[i]//gcd(S,T[i])
print(S)

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

n = int(input())

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

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

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

print(lcm_list(t))

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

Solution (Python):
from fractions import gcd


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

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

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

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

print(lcm(t))

Solution (Python):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
from functools import reduce

i_i = lambda: int(i_s())
i_l = lambda: list(map(int, stdin.readline().split()))
i_s = lambda: stdin.readline().rstrip()

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(l):
    return reduce(lcm, l, 1)

N = i_i()
T = [i_i() for _ in range(N)]

print(lcm_list(T))

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

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

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

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

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

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

    print(res)

if __name__ == "__main__":
    resolve()

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 i in range(n)]
print(lcm_list(t))

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

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

ans= reduce(lcm, a_ls)
print(ans)

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

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

g = reduce(lcm_base,li,1)
print(g)

Solution (Python):
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

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

    return a

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


ans = 1
for a in A:
    ans = lcm(ans, a)

print(ans)

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

Solution (Python):
import fractions



N = int(input())

ARR = []

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

def calculate(arr):
    arr = sorted(arr)
    s = arr[0]
    for i, ar in enumerate(arr):
        if i == 0:
            continue
        else:
            s = zuixiaogongbeishuAtcoder(s,ar)

    print(s)


def zuixiaogongbeishuAtcoder(a, b):
    f = fractions.gcd(a, b)
    res = a * b // f
    return res








calculate(ARR)

Solution (Python):
import fractions
from functools import reduce

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

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

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

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

print(lcm(*T))

Solution (Python):
from fractions import gcd


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

print(lcm)

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())
a = [int(input()) for i 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(a))

Solution (Python):

from fractions import gcd


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


n=int(input())
t=[]
for i in range(n):
    t.append(int(input()))
             
if n==1:
    print(t[0])
else:
    tlcm=t[0]
    for i in range(1,n):
        tlcm=lcm(tlcm,t[i])
    print(tlcm)

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

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

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

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

print(ans)

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

ans=t[0]

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

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

Solution (Python):
n=int(input())
t=[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(t))

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

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

print(a)

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

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

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

import fractions
from functools import reduce

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

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


print(lcm_list(T_arr))

Solution (Python):
from fractions import gcd 

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

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

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

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

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

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

print(reduce(multOverGcd,Tn))

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

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

Solution (Python):
n = int(input())
t = [int(input()) 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)

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

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

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

Solution (Python):
n=int(input())
'''
if n==1:
    print(input())
    quit()
 '''   
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 = int(input())
for i in range(n-1):
    tmp = int(input())
    ans = lcm(tmp,ans)
print(ans)

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

if n==1:
    print(input())
    quit()
    
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 = int(input())
for i in range(n-1):
    tmp = int(input())
    ans = lcm(tmp,ans)
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)


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

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

    print(result)


if __name__ == "__main__":
    main()

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

Solution (Python):
from fractions import gcd
def main():
    n = int(input())
    m = int(input())
    for _ in range(n-1):
        t = int(input())
        m = m*t//gcd(m,t)

    print(m)

if __name__ == "__main__":
    main()

Solution (Python):

from functools import reduce

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

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

print(reduce(func, T))

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

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

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

import fractions

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

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

from fractions import gcd


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

print(lcm(t))

Solution (Python):
from fractions import gcd
from functools import reduce
n=int(input())
t=[]
for _ in range(n):
    t.append(int(input()))
def lcm(a,b):
    return a*b//gcd(a,b)
lc=reduce(lcm,t)
print(lc)

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

def gcd(n, m):
    if m > n:
        n, m = m, n
    if m == 0:
        return n
    r = 0
    while n % m != 0:
        r = n % m
        n = m
        m = r
    return m

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

def lcm_vec(v):
    r = v[0]
    for i in v[1:]:
        r = lcm(r, i)
    return r

print(lcm_vec(a))

Solution (Python):
def resolve():

    N=int(input())
    S=[int(input()) for i in range(N)]
    from functools import reduce
    from fractions import gcd

    def lcm(A,B):
        return A* B // gcd(A, B)

    

    print(reduce(lcm,S))




resolve()

Solution (Python):

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


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


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


alcm = t[0]
for i in t[1:]:
  alcm = lcm(alcm, i)

print(alcm)

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

if __name__ == "__main__":
    main()

Solution (Python):
from fractions import gcd

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

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

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

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

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

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