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
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
from functools import reduce
mod = 10 ** 9 + 7
 

def ii(): return int(sys.stdin.readline().rstrip()) 
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) 
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]

def ss(): return sys.stdin.readline().rstrip() 
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) 
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]





n=ii()
t=lin(n)


def lcm_base(x, y):
    return (x * y) // gcd(x, y)
def lcm(numbers):
    return reduce(lcm_base, numbers, 1)

print(lcm(t))

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

Solution (Python):
N = int(input())
lst = [1] + [int(input()) for _ in range(N)]


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


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


ret = lcm(lst[0], lst[1])
for x in lst[2:]:
    ret = lcm(ret, x)
print(ret)

Solution (Python):
def gcd(n,m):
    if n==0:
        return m
    elif m==0:
        return n
    elif n>m:
        n=n%m
        return gcd(n,m)
    else:
        m=m%n
        return gcd(n,m)
def lcm(n,m):
    return n*m//gcd(n,m)


def longlcm(A):
    import copy
    if len(A)==2:
        return A[0]*A[1]//gcd(A[0],A[1])
    else:
        x=A[0]
        for i in range(1,len(A)):
            x=lcm(x,A[i])
        return x

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

print(longlcm(T))

Solution (Python):
def gcd(n,m):
    if n==0:
        return m
    elif m==0:
        return n
    elif n>m:
        n=n%m
        return gcd(n,m)
    else:
        m=m%n
        return gcd(n,m)
def lcm(n,m):
    return n*m//gcd(n,m)


def longlcm(A):
    import copy
    if len(A)==2:
        return A[0]*A[1]//gcd(A[0],A[1])
    else:
        x=A[0]
        for i in range(1,len(A)):
            x=lcm(x,A[i])
        return x

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

print(longlcm(T))

Solution (Python):

import math

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

N=int(input())

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

cal = T[0]

i = 1
now = T[0]
while(i<N):
    m = T[i] * now
    now = m // gcd(now, T[i])
    i+=1
print(now)

Solution (Python):

import fractions
from functools import reduce

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

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

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

print(ans)

Solution (Python):
n = 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)
ans = 1
for i in range(n):
    t = int(input())
    ans = LCM(ans,t)

print(ans)

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

from fractions import gcd

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

print(list_lcm(A))

Solution (Python):
import fractions

n = int(input())
x = int(input())
ans = x

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

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

import fractions

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

Solution (Python):
import sys
import fractions

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

Solution (Python):
import fractions

n = int(input())
x = int(input())
ans = x

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

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

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

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

Solution (Python):
def lcm(a, b):
    x, y = a, b
    while y != 0:
        x, y = y, x % y
    return a * b // x

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

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

Solution (Python):
import fractions

def a(A, B):
    C = fractions.gcd(A, B)
    return (A * B)//C

N = int(input())

T = []

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

T = sorted(T)
C = T[0]

if N > 1:
    for i in range(1, N):
        C = a(C, T[i])
print(C)

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

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

Solution (Python):
from fractions import gcd

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

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

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

print(a)

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

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

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

print(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)
print(reduce(lcm,t))

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


n = int(input())


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


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

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

print(lcm(*t))

Solution (Python):
import sys
import numpy as np


n = int(input())


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

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

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

if (n == 1):
    print(t[0])
else:
    ans = 1
    for num in t:
        ans = lcm(ans, num)
    print(int(ans))

Solution (Python):



from fractions import gcd
def Lcm(list):
  L = 1
  for a in list:
    L = (a // gcd(a, L))*L
  return L
n= int(input())
A = [int(input()) for i in range(n)]
print(Lcm(A))

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

n = int(input())
ans = 1

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

Solution (Python):

import sys
sys.setrecursionlimit(10000000)
INF = 1<<32


def solve(N: int, T: "List[int]"):
    from functools import reduce

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

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

    def gcd_base(a: int, b: int):
        while b:
            a, b = b, a%b

        return a

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

    print(lcm(*T))
    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):
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):
N = int(input())
S = []
for _ in range(N):
    S.append(int(input()))

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

result=1
for num in S:
    result = lcm(result,num)
print(result)

Solution (Python):
def solve(n, T):

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

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

    l = T.pop()
    for t in T:
        l = lcm(l, t)
    return l

_n = int(input())
_T = [int(input()) for _ in range(_n)]
print(solve(_n, _T))

Solution (Python):
import math
import calendar
import fractions
import itertools
from fractions import gcd
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):
import fractions
N = int(input())
ans = 1
for _ in range(N):
    t = int(input())
    ans = ans * t // fractions.gcd(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 *= t[i]//gcd(ans,t[i])
print(ans)

Solution (Python):
import fractions

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

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

print(result)

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

Solution (Python):

from fractions import gcd
N = int(input())
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):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,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 LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(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=I()

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

  return ans


print(main())

Solution (Python):

"""
Created on Mon Jan 27 23:19:24 2020

@author: H_Hoshigi
"""

import fractions

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

LCM = T_list[0]

for i in T_list:
    GCD = fractions.gcd(LCM, i)
    LCM = (LCM * i)//GCD

print(LCM)

Solution (Python):


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

Solution (Python):

import fractions as math

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

N=int(input())
ans=lcm(1,int(input()))

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

print(ans)

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

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

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

N = int(input())
ans = int(1)
for i 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(N):
    ans = (ans * T[i]) // gcd(ans, T[i])
print(ans)

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

if n == 1:
    print(times[0])
else:
    prev_lcm = times[0]
    for t in times[1:]:
        tmp = gcd(prev_lcm, t)
        lcm = prev_lcm * t // tmp
        prev_lcm = lcm
    print(lcm)

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

if n == 1:
    print(times[0])
else:
    prev_lcm = times[0]
    for t in times[1:]:
        tmp = gcd(prev_lcm, t)
        lcm = prev_lcm * (t // tmp)
        prev_lcm = lcm
    print(lcm)

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

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

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

Solution (Python):
from fractions import gcd

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

Solution (Python):
from fractions import gcd

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

Solution (Python):
import sys
import fractions

input = sys.stdin.readline


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

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

    print(ans)


if __name__ == '__main__':
    main()

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


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


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

Solution (Python):
import fractions

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

def main():
    n = int(input())
    T = []
    for x in range(n):
        T.append(int(input()))
    print(lcm(T))

if __name__ == '__main__':
    main()

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


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


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

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

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

print(functools.reduce(lcm, 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())
T = []
for _ in range(N):
    T.append(int(input()))

print(lcm(*T))

Solution (Python):

 
import math
import itertools
import sys
import copy
 






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


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

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

def gcd(x,y):
    if x==0:return y
    else:return gcd(y%x,x)
a = int(input())
s = 1
for i in range(a):
    t= int(input())
    s = (t*s)//gcd(t,s)
print(s)

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


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


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


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

print(lcm(Tn))

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

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

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

Solution (Python):
from functools import reduce

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



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


if __name__ == "__main__":
    n = int(input())
    lst = []
    for i in range(n):
        lst.append(int(input()))
    print(reduce(lcm,lst))

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



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


if __name__ == "__main__":
    n = int(input())
    lst = []
    for i in range(n):
        lst.append(int(input()))
    print(reduce(lcm,lst))

Solution (Python):
import fractions

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

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

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

    print(ans)

if __name__ == '__main__':
    main()

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

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

print(lcm(t))

Solution (Python):
N = int(input())
T=[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 * b // gcd(a, b)
if N>1:
    ans = lcm(T[0], T[1])
    for i in range(2,N):
        ans = lcm(ans, T[i])
else:
    ans=T[0]
print(ans)

Solution (Python):
from fractions import gcd
n=int(input())
g=1
def lcm(x,y):
    return (x*y)//gcd(x,y)

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

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

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


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

print(l)

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

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

from fractions import gcd
from functools import reduce

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

print(reduce(lcm, T))

Solution (Python):
"""import sys
input = sys.stdin.readline().strip"""
n=int(input())
T=[int(input()) for _ in range(n)]
if n==1:
    print(T[0])
    exit()
from fractions import gcd
ans=T[0]*T[1]//gcd(T[0],T[1])
for t in T:
    ans=ans*t//gcd(ans,t)
print(ans)

Solution (Python):
import sys
n = int(input())
t_ls = []
for i in range(n):
    t_ls.append(int(sys.stdin.readline().strip()))

def gcd(a, b):
    while a and b:
        if a < b:
            b %= a
        else:
            a %= b
    return max(a, b)

def scm(a, b):
    _gcd = gcd(a, b)
    return a * b // _gcd

res = 1
for t in t_ls:
    res = scm(res, t)
print(res)

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

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

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

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

print(lcm_list(t))

Solution (Python):


import numpy as np

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

t=int(input())
ans=1
for _ in range(t):
    k=int(input())
    ans=ans*k//gcd(ans,k)
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):
N = int(input())
T = []

for _ in range(N):
	T.append(int(input()))
	
def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)

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

Solution (Python):
from fractions import gcd
N = int(input())
T = list(set([int(input()) for _ in range(N)]))
ans = 1
def lcm(a,b):
    return (a*b)//gcd(a,b)
for i in range(len(T)):
    ans = lcm(ans,T[i])
print(ans)

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 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 S(): return input()

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

def main():
    N = I()
    T = []
    for _ in range(N):
        T.append(I())
    n_lcm = lcm(T[0], T[0])
    for i in range(1, N):
        n_lcm = lcm(n_lcm, T[i])
    print(n_lcm)
main()

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

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

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

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

print(lcm_ls(ls))

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

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


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

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

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

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())
L=[int(input()) for _ in range(N)]
print(lcm_list(L))

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

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

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

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

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)

print(lcm_list(T))

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

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

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

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

print(ans)

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

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

if n == 1:
    ans = t[0]
else:
    lcd = t[0]*t[1]//gcd(t[0],t[1])
    for i in range(2,n):
        lcd = lcd*t[i]//gcd(lcd,t[i])
    ans = lcd

print(ans)

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

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

from fractions import gcd
lcm=1
for i in range(n):
    lcm=(lcm*t[i])//gcd(lcm,t[i])
print(lcm)

Solution (Python):
from fractions import gcd

def lcm(a,b):
    return a*b//gcd(a,b)
def main():
    n=int(input())
    T=set(list(int(input()) for _ in  range(n)))
    ans=1
    for t in T:
        ans = lcm(t,ans)
    print(ans)
main()

Solution (Python):
import fractions


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


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

Solution (Python):
import fractions
from functools import reduce

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

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

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

print(lcm(T))

Solution (Python):
import fractions
from functools import reduce

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

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

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

print(lcm(T))

Solution (Python):
import sys
from collections import defaultdict, deque
import bisect
from heapq import *
from math import factorial
sys.setrecursionlimit(200000)
input = sys.stdin.readline

N, = map(int, input().split())



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



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

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

print(ans)

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

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


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

print(ans)

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

def gcd(a,b):
  while b:
    a,b = b,a%b
  return a
  
ans = 1
for _ in range(n):
    x = int(input())
    ans *=  x//gcd(ans,x)
print(ans)

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

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

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

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

print(lcm_list(T))

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

print(ans)

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

Solution (Python):
from functools import reduce

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 gcd_list(numbers):
    return reduce(gcd, numbers)

def lcm_list(numbers):
    return reduce(lcm, numbers, 1)
    
N = int(input())
times = [int(input()) for i in range (N)]

print(lcm_list(times))

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

if N == 1:
    T = int(input())
    print(T)
    exit()

T = []
for i in range(N):
    T.append(int(input()))
    
lcm_T = lcm(T[0], T[1])
for i in range(2, N):
    lcm_T = lcm(lcm_T, T[i])
    
print(lcm_T)

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

N=int(input())
A=int(input())
answer=A
for i in range(1,N):
  T=int(input())
  answer=answer*T//gcd(answer,T)
print(answer)

Solution (Python):

try:
    from fractions import gcd
except:
    from math import gcd
N = int(input())
T = []
for i in range(N):
    t = int(input())
    T.append(t)
ans = T[0]
for i in range(1, N):
    ans = (ans * T[i]) // gcd(ans, T[i])
print(ans)