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 sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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 = int(input())
    T[i] = t

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

print(ans)

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

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

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

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


if __name__ == "__main__":
    main()

Solution (Python):
import fractions

N=int(input())
T0=int(input())

if N==1:
  print(T0)
  exit()

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

Solution (Python):
import fractions
n=int(input())
t=[int(input()) for i in range(n)]
t.sort()
check=t[0]
if n==1:
    print(check)
else:
    for i in range(n-1):
        f1=fractions.gcd(check,t[i+1])
        f2=check*t[i+1]//f1
        check=f2
    print(f2)

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

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

print(reduce(lambda a, b: lcm(a,b),T))

Solution (Python):
"""


 = sys.stdin.readline().rstrip()
 = list(sys.stdin.readline().rstrip())


 = int(sys.stdin.readline())
 = map(int, sys.stdin.readline().split())
 = list(map(int, sys.stdin.readline().split()))
 = [list(map(int,list(sys.stdin.readline().split()))) for i in range(h)]  


a = 100
b = 0.987654321
print("{0:06d}-{1:6f}".format(a,b))
000100-0.987654


char_list = list("abcd") 
"""

import math
import sys
import itertools
import queue
from fractions import gcd
from functools import reduce

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

mod = 1000000007

if __name__ == "__main__":
    n = int(sys.stdin.readline())
    l=[]
    for i in range(n):
        t = int(sys.stdin.readline())
        l.append(t)

    print(reduce(lcm,l))

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

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

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

if len(T) == 1:
  print(T[0])
elif len(T) == 2:
  print(lcm(*T))
else:
  ans = lcm(T[0], T[1])
  for i in range(2, N):
    ans = lcm(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=t[0]
for i in range(1,n):
    ans=lcm(ans,t[i])

print(ans)

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(numbers):
  return reduce(lcm_base, numbers, 1)

ans = lcm_list(T)

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):
def f(x,y):
    if x<y: x,y = y,x
    if y==0: return x
    else: return f(y, x%y)
N = int(input())
ans = 1
for _ in range(N):
    T = int(input())
    ans = ans*T//f(ans,T)
print(ans)

Solution (Python):
from functools import reduce
from fractions import gcd
n=int(input())
a=[int(input()) for i 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(a))

Solution (Python):
import sys
import copy
import  math
import bisect
from collections import *
from operator import itemgetter

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

stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

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

Solution (Python):
from sys import stdin
import fractions
def lcm(a, b):
  return a * b // fractions.gcd(a, b)
N = int(stdin.readline().rstrip())
ans = 1
for _ in range(N):
    ans = lcm(ans,int(input()))
print(ans)

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

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

N = int(input())
tlist = [int(input()) for _ in range(N)]
print(lcmm(tlist))

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

Solution (Python):
def lcm(a, b):
    if a < b:
        a2, b2 = b, a
    else:
        a2, b2 = a, b
    while b2 != 0:
        a2, b2 = b2, a2%b2
    return a*b//a2

N = int(input())
T1 = int(input())
if N == 1:
    ans = T1
else:
    T2 = int(input())

    ans = lcm(T1, T2)

    for i in range(N-2):
        Ti = int(input())
        ans = lcm(ans, Ti)

print(ans)

Solution (Python):
from decimal import *

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

for i in range(n):
    T[i] = Decimal(T[i])

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

ans = Decimal(1)
for i in range(n):
    if ans % T[i] != 0:
        ans = ans * T[i] / gcd(ans, T[i])
    
    
print(int(ans))

Solution (Python):
from decimal import *

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

for i in range(n):
    T[i] = Decimal(T[i])

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

ans = Decimal(1)
for i in range(n):
    if ans % T[i] != 0:
        ans = ans * T[i] / gcd(ans, T[i])
    
    
print(int(ans))

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

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


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


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

print(reduce(lcm, 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
def lcm(a,b):return a*b//gcd(a,b)

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):
import fractions
n=int(input())
t=[int(input()) for i in range(n)]
gc=t[0]
for i in range(n):
  gc=(gc*t[i]) // fractions.gcd(gc,t[i])
print(gc)

Solution (Python):
from fractions import gcd


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


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

ret = 1
for i in range(n):
    ret = lcm(ret, ts[i])
print(ret)

Solution (Python):
from fractions import gcd

N = int(input())
T = set()
for i in range(0, N):
    T.add(int(input()))
ans = 1
for i in T:
    ans = ans*i//gcd(ans, i)
print(ans)

Solution (Python):

def computeGCD(x, y): 
   while(y):
   		x, y = y, x % y
   return x 
n=int(raw_input())
ar=[]
for i in range(0,n):
	k=int(raw_input())
	ar.append(k)

an=ar[0]
for x in range(1,n):
	an=(an*ar[x])/computeGCD(an,ar[x]);
print(an)

Solution (Python):
import fractions
from functools import reduce

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

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

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

print(lcm_list(Ts))

Solution (Python):
import fractions

n=int(input())
t=list(int(input()) for i 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)]
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):
import numpy as np
n=int(input())
T=np.array([int(input()) for _ in range(n)], dtype=np.int64)

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

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

print(ans)

Solution (Python):


import fractions

n = int(input().split()[0])
t_list = []

for _ in range(n):
    t_list.append(int(input().split()[0]))

t_list = list(set(t_list))
a = t_list[0]

for t in t_list[1:]:
    a = a * t // fractions.gcd(a, t)

print(a)

Solution (Python):
from functools import reduce
N = int(input())
T = [int(input()) for _ in range(N)]
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)
print(reduce(lambda a,b: a*b//gcd(a,b),T))

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

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

Solution (Python):
import fractions

N = int(input())

now = 1

for i in range(N):

    T = int(input())

    now = now * T // fractions.gcd(now , T)

print (now)

Solution (Python):
import fractions

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

if len(a) == 1:
    print(a[0])
    exit()

ans = a[0] * a[1] // fractions.gcd(a[0],a[1])

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

Solution (Python):
import fractions
def lcm(a, b):
    y = a*b // fractions.gcd(a, b)
    return (y)
N=int(input())
T = [int(input()) for i in range(N)]
if N==1:
    t=T[0]
else:
    t=lcm(T[0],T[1])
    if N>2:
        for i in range(1,N):
            t=lcm(t,T[i])
print(t)

Solution (Python):

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


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


def lcm_arr(arr):
    ans = arr[0]
    for i in range(1, n):
        ans = lcm(ans, arr[i])
    return ans


n = int(input())
ans = lcm_arr([int(input()) for _ in range(n)])
print(min(ans, 10 ** 18))

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

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

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

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

Solution (Python):
N = int(input())
def calcgcd(a, b):
  if a > b:
    a, b = b, a
  while a > 0:
    a, b = b%a, a
  return b
def calclcm(a, b):
  return a*b//calcgcd(a, b)
r = 1
for i in range(N):
  T = int(input())
  r = calclcm(r, T)
print(r)

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

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

    if N == 1: return T[0]

    g = T[0]
    ans = T[0]
    for t in T[1:]:
        gc = gcd(t, g)
        g = g*t//gc
    return g

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




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

Solution (Python):
from functools import reduce

try:
    from math import gcd
except:
    from fractions import gcd


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


N = int(input())
T = []
for _ in range(N):
    T.append(int(input()))
ans = reduce(gcm, T, 1)
print(ans)

Solution (Python):
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
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 LI_(): return [int(x)-1 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 _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def _pf(s): return print(s, flush=True)

N = _I()
T = set([_I() for _ in range(N)])

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

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

print(l)

Solution (Python):
import sys
sys.setrecursionlimit(10**7)
N = int(input())
ts = [int(input()) for _ in range(N)]

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

l = 1
for t in ts:
    l = lcm(l,t)
    
print(l)

Solution (Python):

from fractions import gcd


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


if __name__ == "__main__":
    main()

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)

T.sort()
ans = T.pop(0)
for t in T:
    ans = lcm(ans,t)
print(ans)

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

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


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



ret = li[0]
if len(li) != 1:
    for i in range(1, n):
        ret = lcm(ret, li[i])
print(ret)

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)

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

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

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

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

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

Solution (Python):
import sys

sys.setrecursionlimit = 10000000

def get_gcd(A, B):
    r = A%B
    if r == 0:
        return B
    else:
        return get_gcd(B, r)
           
if __name__ == '__main__':
    N = int(input())
    T = [int(input()) for _ in range(N)]
    
    ans = 1
    for t in T:
        gcd = get_gcd(ans, t)
        ans = t//gcd*ans
        
    print(ans)

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


def least_common_multiple(iter):
    '''
    最小公倍数を返す
    '''
    lcm = lambda x, y: x*y//gcd(x, y)
    return reduce(lcm, iter)


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

Solution (Python):
import fractions

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

N=int(input())

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

if N==1:
    print(A[0])
    exit(0)
k=lcm(A[0],A[1])
for i in range(2,N):
    k=lcm(k,A[i])
print(k)

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 sys
import fractions
input = sys.stdin.readline

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

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

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

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

N=int(input())
T =[int(input()) for i in range(N)]
print(reduce(lambda x,y:x*y//gcd(x,y), T))

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

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

Solution (Python):
import bisect
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

N = int(sys.stdin.readline())
T = [int(sys.stdin.readline()) for _ in range(N)]


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


a = reduce(lcm, T)
print(a)

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

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

N = int(input())
T = {int(input()) for _ in range(N)}

res = 1
for t in T:
	res = res * t // gcd(res, t)
print(res)

Solution (Python):
import fractions
from functools import reduce


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


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


if __name__ == '__main__':
    n = int(input())
    t = [int(input()) for i in range(n)]

    print(lcm_list(t))

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

Solution (Python):
from fractions import gcd

n = int(input())
tn = [int(input()) for _ in range(n)]
answer = tn[0]
for i in range(1,n):
    answer = answer * tn[i] // gcd(answer,tn[i])
print(answer)

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(numbers):
	return reduce(lcm_base, numbers,1)

print(lcm_list(T))

Solution (Python):
import fractions

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

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

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

def lcm(l):
  return reduce(lambda x, y: (x * y) // gcd(x, y), l, 1)

print(lcm(int(input()) for _ in range(int(input()))))

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

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

ans = int(input())

def gcd(n, m):
    n, m = max(n, m), min(n, m)
    if m == 0:
        return n
    return gcd(m, n % m)


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

print(ans)

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

n = int(input())
for i in range(n):
    t = int(input())
    if i == 0:
        t1 = t
    else:
        t2 = t
        gcdt = gcd(t1,t2)
        lcn = t1*t2//gcdt
        t1 = lcn
print(t1)

Solution (Python):
import sys
n = int(input())
src = [int(input()) for _ in range(n)]
if n == 1:
    print(src[0])
    sys.exit()

def check(a, b):
    if a < b:
        a, b = b, a
    while a % b != 0:
        a, b = b, a % b
    return b
tmp = src[0]
for i in range(n-1):
    tmp = tmp//check(tmp, src[i+1])*src[i+1]
print(tmp)

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

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

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

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

print(ans)

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):
from functools import reduce
def GCD(a:int , b: int) -> int:
    return a if b == 0 else GCD(b, a % b)
def LCM(a: int, b: int) -> int:
    return a * b // GCD(a, b)

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

ans = reduce(LCM, t)

print(ans)

Solution (Python):
def GCD(a:int , b: int) -> int:
    return a if b == 0 else GCD(b, a % b)
def LCM(a: int, b: int) -> int:
    return a * b // GCD(a, b)

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

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

print(ans)

Solution (Python):
n = int(input())
lcm = 1
for i in range(n):
  tmp = int(input())
  big = lcm
  sml = tmp
  while sml > 0:
    big,sml = sml,big%sml
  gcd = big
  lcm = lcm * tmp // gcd
print(lcm)

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

from fractions import gcd

for i in range(N):
  a = int(input())
  ans = (a*ans) // gcd(a,ans)

print(ans)

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

import sys
INF = float("inf")


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


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


def solve(N: int, T: "List[int]"):
    ans = 1
    for i in range(N):
        ans = LCM(ans, T[i])

    print(ans)

    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    T = [int(next(tokens)) for _ in range(N)]  
    solve(N, T)


if __name__ == '__main__':
    main()

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

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

Solution (Python):
import fractions

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

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

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

Solution (Python):
import fractions

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

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

ans = nums[0]

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

print(ans)

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

print(ans)

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)

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

Solution (Python):

a = int(input())
c = [int(input()) for i in range(a)]

import fractions

def lcm(x,y):
    return x*y//fractions.gcd(x,y)
ret = 1
for i in c:
    ret = lcm(ret,i)
print(ret)

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




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

l = 1
g = 0
for t in T:
    l = lcd(l, t)
    g = gcd(g, t)
print(l)

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

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

print(lcmm(T))

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

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

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

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

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

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

print(ans)

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

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)

print(lcm(*T))

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


def l_c_m(x, y):
    return x * y // g_c_d(x, y)


a = int(input())
b = 1
for i in range(a):
    c = int(input())
    b = l_c_m(b, c)
print(b)

Solution (Python):
import fractions

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

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

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

import sys
import math
from collections import defaultdict


sys.setrecursionlimit(10**7)
def input():
  return sys.stdin.readline()[:-1]


mod = 10**9 + 7


def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
  read_all = [tuple(map(int, input().split())) for _ in range(N)]
  return map(list,zip(*read_all))



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

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

Solution (Python):
import fractions as fc
from functools import reduce
N=int(input())
T=[int(input()) for _ in range(N)]
def lb(x,y):
    return (x*y)//fc.gcd(x,y)
def lc(*n):
    return reduce(lb,n,1)
print(lc(*T))

Solution (Python):

import fractions

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

Solution (Python):



import fractions


def main():
    n = int(input())
    t = [None] * n

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

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


if __name__ == '__main__':
    main()

Solution (Python):
def l(a, b):
  if a > b:
    a, b = b, a
  return l(a, b % a) if b % a else a

def g(a, b):
  return a * b // l(a, b)

N = int(input())
res = 1
for n in range(N):
  res = g(res, int(input()))

print(res)

Solution (Python):
from fractions import gcd

n = int(input())
t_array = [int(input()) for x in range(n)]
ans = t_array[0]
for t in t_array[1:]:
    ans = ans*t//gcd(ans, t)
print(ans)

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):
import fractions
n=int(input())
t=[int(input()) for _ in [0]*n]

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

Solution (Python):
import sys
import fractions


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


n = int(sys.stdin.readline())
t = [int(x) for x in sys.stdin.readlines()]
total_lcm = 1
for i in t:
    total_lcm = lcm(total_lcm, i)
print(total_lcm)

Solution (Python):
import fractions

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

Solution (Python):
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush
from fractions import gcd
from copy import deepcopy
import math
Mod = 1000000007



def main(): 
    N = int(input())
    T = [int(input()) for i in range(N)]
    def LCM(i,j):
        return i*j//gcd(i,j)
    tempans = [T[0]]*(N)
    for i in range(1,N):
        tempans[i] = LCM(tempans[i-1],T[i])
    print(tempans[N-1])
if __name__ == "__main__":
    main() 




def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n < 2 is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))):
        if prime[i] == 1:
            for j in range(2*i,n):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n):
        if prime[i] == 1:
            res.append(i)
    return res

class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[py] = px
        else:
            self.parent[px] = py

    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)

Solution (Python):


def gcm(q,r): 
    if q<r: q, r = r, q
    while(r>0): q, r = r, q%r,
    return q

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

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

Solution (Python):


def gcm(q,r): 
    if q<r: q, r = r, q
    while(r>0): q, r = r, q%r,
    return q

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

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

Solution (Python):


def gcm(q,r): 
    if q<r: q, r = r, q
    while(r>0): q, r = r, q%r,
    return q

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

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

Solution (Python):


def gcm(q,r): 
    if q<r: q, r = r, q
    while(r>0):
        q, r = r, q%r,
    return q

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

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