Problem:
 Score : 300 points    Problem Statement We have N clocks. The hand of the i -th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again?      Constraints  1≤N≤100   1≤T_i≤10^{18}   All input values are integers.  The correct answer is at most 10^{18} seconds.         Input Input is given from Standard Input in the following format:  N  T_1  :  T_N       Output Print the number of seconds after which the hand of every clock point directly upward again.        Sample Input 1 2
2
3      Sample Output 1 6  We have two clocks. The time when the hand of each clock points upward is as follows:   Clock 1 : 2 , 4 , 6 , ... seconds after the beginning  Clock 2 : 3 , 6 , 9 , ... seconds after the beginning   Therefore, it takes 6 seconds until the hands of both clocks point directly upward.       Sample Input 2 5
2
5
10
1000000000000000000
1000000000000000000      Sample Output 2 1000000000000000000

Solution (Python):
from fractions import gcd

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

def lcm_list(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_list(T))

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

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

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


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

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

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

print(ans)

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


n = int(input())
t_list = []
ans_list = []
for i in range(n):
    t_list.append(int(input()))
    
    
for i in range(len(t_list)):
    if i == 0:
        ans_list.append(t_list[0])
        continue
    if i == 1:
        ans_list.append(lcm(t_list[0] , t_list[1]))
    
    if i >=2:
        ans_list.append(lcm(ans_list[-1],t_list[i]))
print(ans_list[-1])

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


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

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

N = int(input())
T = [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
from functools import reduce

N = int(input())
T = list(int(input()) for _ 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
from functools import reduce

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


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):
from collections import defaultdict

N = int(input())
Ts = list(set([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 // g * b

res = Ts[0]
for T in Ts:
    res = lcm(res, T)
print(int(res))

Solution (Python):
def main():
    from builtins import int, map, list, print
    from fractions import gcd
    from functools import reduce
    import sys
    def lcm(x, y):
        return (x * y) // gcd(x, y)

    sys.setrecursionlimit(10 ** 6)

    input = sys.stdin.readline
    input_number = (lambda: int(input()))

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

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
_,a,*l=map(int,open(0))
from fractions import*
for i in l:a*=i//gcd(a,i)
print(a)

Solution (Python):
_,a,*l=map(int,open(0))
for i in l:
  x,y=a,i
  while y: x,y=y,x%y
  a*=i//x
print(a)

Solution (Python):
_,a,*l=map(int,open(0).read().split())
for i in l:
  x,y=a,i
  while y: x,y=y,x%y
  a*=i//x
print(a)

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

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

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

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

print(lcm(l))

Solution (Python):
def lcm(x, y):
    import fractions
    return (x * y) // fractions.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)


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

Solution (Python):
import fractions
from functools import reduce

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

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

Solution (Python):
from fractions import gcd


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


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


if __name__ == '__main__':
    solve()

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

from fractions import gcd
def lcms(List):
    __ = 1
    for _ in List:
        __ =int(__ * _ // gcd(__, _))
    return __

print(lcms(l))

Solution (Python):
import fractions

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

ans = t[0]

for tn in t:
    ans = ans * tn // fractions.gcd(ans, tn)

print(ans)

Solution (Python):
import fractions 
n = int(input())
t = [int(input()) for i in range(n)]
def lcm(a, b):
  return (a * b) // fractions.gcd(a, b)


if n == 1:
  print(t[0])
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 = []
for _ in range(n):
    t.append(int(input()))

ans = t[0]
for ti in t:
    ans = ans * ti // fractions.gcd(ans, ti)


print(ans)

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

Solution (Python):
import sys
sys.setrecursionlimit(200000000)

N = int(input())
NUMS = [int(input()) for _ in range(N)]
NUMS = list(set(NUMS))

def gcd(num1, num2):
    if num2 == 0:
        return num1
    else:
        return gcd(num2, num1 % num2)


res = NUMS[0]
for num in NUMS[1:]:
    res = res * num // gcd(res, num)

print(int(res))

Solution (Python):
import sys
import fractions
sys.setrecursionlimit(200000000)

N = int(input())
NUMS = [int(input()) for _ in range(N)]
NUMS = list(set(NUMS))

def gcd(num1, num2):
    if num2 == 0:
        return num1
    else:
        return gcd(num2, num1 % num2)


res = NUMS[0]
for num in NUMS[1:]:
    res = res * num // gcd(res, num)

print(int(res))

Solution (Python):
import sys
import fractions
sys.setrecursionlimit(200000000)

N = int(input())
NUMS = [int(input()) for _ in range(N)]
NUMS = list(set(NUMS))

def gcd(num1, num2):
    if num2 == 0:
        return num1
    else:
        return gcd(num2, num1 % num2)


res = NUMS[0]
for num in NUMS[1:]:
    res = res * num // fractions.gcd(res, num)

print(int(res))

Solution (Python):

import math
import heapq
import bisect
import numpy as np
from collections import Counter
import fractions


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

ans = T[0]
for t in T:
    ans = ans*t//fractions.gcd(ans,t)

print(ans)

Solution (Python):
x=int(input())
a=[]
for i in range(x):
	a.append(int(input()))
ans=1
import fractions
for i in range(len(a)):
	ans=(a[i]*ans)//fractions.gcd(a[i],ans)
print(ans)

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


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

N = int(input())
T = []

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

T.sort()

print(reduce(lcm, T))

Solution (Python):
from fractions import gcd

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

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

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

Solution (Python):

from functools import reduce
import sys
try:
    from typing import List
except ImportError:
    pass


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


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


def solve(N: int, T: "List[int]"):
    print(reduce(lcm, T))


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):
from fractions import gcd
def lcm(list):
    if len(list) == 1:
        return list[0]
    if len(list) == 2:
        [a, b] = list
        return a*b//gcd(a,b)
    x = list.pop()
    y = lcm(list)
    return x*y//gcd(x,y)

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

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

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

def saishokoubaisuu(n,m):
    a = max(n,m)
    b = min(n,m)
    while b:
        a, b = b, a % b
    return n*m//a

ans = 1
for t in Ts:
    ans = saishokoubaisuu(ans,t)
print(ans)

Solution (Python):

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

def lcd(n, m):
    
    a = max(n,m)
    b = min(n,m)
    while b:
        a, b = b, a % b
    return n*m//a

ans = 1
for t in ts:
    ans = lcd(ans,t)
print(ans)

Solution (Python):
def gcd(n, m):
    
    a = max(n,m)
    b = min(n,m)
    while b:
        a, b = b, a % b
    return a
lcd = 1

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

for t in ts:
    lcd = (lcd*t)//gcd(lcd,t)

print(lcd)

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

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

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

print(ans)

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

from fractions import gcd

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

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

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

Solution (Python):
import fractions
from functools import reduce

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

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

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

print(lcm(t))

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

Solution (Python):
def gcb(a,b):
    if a>b:
        x,y=a,b
    else:
        x,y=b,a
    while True:
        if x%y!=0:
            x,y=y,x%y
        else:
            return y
def lcb(a,b):
    return a*b//gcb(a,b)
N=int(input())
T=[int(input()) for _ in range(N)]
ans=1
for i in range(N):
    ans=lcb(ans,T[i])
print(ans)

Solution (Python):
import fractions
N,T1=int(input()),int(input())
for n in range(1,N):
    T2=int(input())
    T1=(T1*T2)//fractions.gcd(T1,T2)
print(T1)

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

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

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

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)

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

print(lcm_list(T))

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


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


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


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


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

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

print(lcm_list(numbers))

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

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


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

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

print(answer)

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

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

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

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

    print(lcm_list(num_list))

if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
from fractions import gcd

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

if N==1:
  print(T[0])
else:
  S[0]=T[0]
  for j in range(1,N):
    a=S[j-1]*T[j]
    S[j]=a//gcd(S[j-1],T[j])
  print(S[-1])

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

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

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

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

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

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

Solution (Python):


N = int(input().strip())
T_list = [int(input().strip()) for _ in range(N)]


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

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


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

print(ans)

Solution (Python):


N = int(input().strip())
T_list = [int(input().strip()) for _ in range(N)]


def gcd(a,b):
    x = max(a,b)
    y = min(a,b)

    while y != 0:
        r = x % y
        
        x = y
        y = r
    
    return x

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


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

print(ans)

Solution (Python):
def main():
  n = int(input())
  t = []
  for _ in range(n):
    t.append(int(input()))
  print(lcm_list(t))
  
def input_list():
  return map(int, input().split())

def input_list_str():
  return map(str, input().split())

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

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

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

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


def divide_two(arg):
  c = 0
  while True:
    if c >= 2:
      break
    if arg % 2 != 0:
      break
    arg //= 2
    c += 1
  return c 

import math
import fractions
from functools import reduce
main()

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


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


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


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

print(M)

Solution (Python):
import fractions

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

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

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

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

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

print(ans)

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

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

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

from fractions import gcd

def mygcd(a,b):
    gcd_list = []
    for i in range(1,int(min(a,b)**0.5)+1):
        if a%i == 0 and b%i == 0:
            gcd_list.append(i)
    return max(gcd_list)

number = T[0]

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

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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
from fractions import gcd

def main():
    mod=10**9+7
    N=I()
    ans=1
    for i in range(N):
        t=I()
        ans=(ans*t)//gcd(ans,t)
        
    print(ans)

main()

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

Solution (Python):

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


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

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

print(ans)

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


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


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

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


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


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

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

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


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


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

Solution (Python):
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(n,m):
    return n*m//gcd(n,m)

ans=1

for t in T:
    ans=lcm(max(ans,t),min(ans,t))

print(ans)

Solution (Python):
import fractions as math
a = int(input())
c = 1
for i in range(a):
  b = int(input())
  c = b*c//math.gcd(b,c)
print(c)

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

Solution (Python):
import fractions
from functools import reduce

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

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

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

print (lcm_list(l))

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

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

Solution (Python):
import fractions

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

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

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

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

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

T = int(input())
for i in range(N-1):
    T_ = int(input())
    T = lcm(T, T_)

print(T)

Solution (Python):
import fractions

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

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

ans = T[0]

for i in range(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
def lcm(x,y):
    return (x*y)//fractions.gcd(x,y)

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

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

import fractions
if n==1: print(t[0])
else:
    a,b=t[0],t[1]
    res=a*b//fractions.gcd(a,b)
    for i in range(2,n):
        tmp=t[i]
        res = res*tmp//fractions.gcd(res,tmp)
    print(res)

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

Solution (Python):



from fractions import gcd 
from functools import reduce
import sys
sys.setrecursionlimit(200000000)
from inspect import currentframe




def printargs2err(*args):
    names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' : '+repr(arg) for arg in args),file=sys.stderr)
def debug(x):
    print(x,file=sys.stderr)
def printglobals():
    for (symbol, value) in globals().items():
        print('symbol="%s"、value=%s' % (symbol, value),file=sys.stderr)
def printlocals():
    for (symbol, value) in locals().items():
        print('symbol="%s"、value=%s' % (symbol, value),file=sys.stderr)

def pin(type=int):
    return map(type,input().split())



def modular_w_binary_method (n,m,p):
    ans=1 if n>0 else 0
    while(p>0):
        if p%2==1:
            ans=(ans*n)%m
        n=(n**2)%m
        p//=2
    return ans

"""
    フェルマーの小定理より a**(p)%p==a isTrue
    これを利用すれば a**(p-2)%p==a**(-1) isTrue
    元と逆元とをかけてpで割れば1が余るよ！
"""
def modular_inverse(a,prime):
    return(modular_w_binary_method(a,prime,prime-2))

def conbination(n,a,mod=10**9+7):
    
    res=1 
    for s in range(a):
        res=(res*(n-s)*(modular_inverse(s+1,mod)))%mod

        
    return res

"""
"""




N,=pin()
T=[int(input()) for i in range(N)]
from fractions import gcd
def lcm2(x, y):
    return (x * y) // gcd(x, y)
def lcm(numbers):
        return reduce(lcm2,numbers,1)
print(lcm(T))





"""


"""
"""
お前カッコ閉じるの忘れてるだろ
"""

Solution (Python):


import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

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

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

n = ni()
T = nin(n)

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

print(ans)

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

Solution (Python):
from fractions import gcd

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

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

Solution (Python):
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())
t0=int(input())
if n==1:
    print(t0)
else:
    t1=int(input())
    t_lcm=lcm(t0,t1)
    for i in range(n-2):
        t2=int(input())
        t_lcm=lcm(t_lcm,t2)
    print(t_lcm)

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


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


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


if __name__ == '__main__':
    main()

Solution (Python):
def gcd(n,m):
    if n < m:
        t = n
        n = m
        m = t
    r = n % m
    while r > 0:
        n, m = m, r
        r = n % m
    return m
N = int(input())
T = [int(input()) for _ in range(N)]
ans = T[0]
for i in range(1,N):
    g = gcd(ans,T[i])
    ans = ans*T[i]//g
print(ans)

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


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


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

Solution (Python):
from fractions import gcd

n = int(input())
t = [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 range(N)]


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


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

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

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



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

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

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

print(ans)

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

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

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

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

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


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

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

Solution (Python):
import fractions

t = 1
n = int(input())

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

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

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


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


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

Solution (Python):
import fractions

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

def saiki(n , t , maxi):

    saikimaxi = 0
    for i in range(n):
        if maxi % t[i] != 0:
            saikimaxi = max(saikimaxi , t[i])

    if saikimaxi != 0:
        return saiki(n , t , lcm(maxi , saikimaxi))
    else:
        return maxi

def multiclocks(n , t):

    maxi = max(t)
    return saiki(n , t , maxi)

def main():
    n = int(input())
    t = [int(input()) for i in range(n)]
    print(multiclocks(n , t))

if __name__ == '__main__':
    main()

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

import math
import fractions


def union_lcm(lists):
    if len(lists)==1:
        return lists[0]
    elif len(lists)>1:
        num=lists[0]
        for i in range(1,len(lists)):
            num=num*lists[i]//fractions.gcd(num,lists[i])
        return num
P=union_lcm(lists)
print(P)

Solution (Python):
import fractions

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

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

ans = T[0]

for index, t in enumerate(T):
  if index == 0:
    continue

  ans = lcm(ans, t)

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


n=int(input())
ab = []
for _ in range(n):
    a= int(input())
    ab.append(a)
print(lcm(ab))