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

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

p = t[0]
for i in range(1, len(t)):
    q = t[i]

    if p >= q:
        m, n = p, q
    else:
        m, n = q, p

    while True:
        mod_value = m % n
        if mod_value  == 0:
            break

        m = n
        n = mod_value

    p = p//n * q

print(p)

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

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


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

if N == 1:
    print(T[0])

else:
    LCM = lcm(T[0], T[1])
    
    for i in range(1, N-1):
        LCM = lcm(LCM, T[i+1])
    
    print(LCM)

Solution (Python):
import sys
sys.setrecursionlimit(10**8)
n=int(input())
t=[int(i) for i in sys.stdin]
if n==1:
  print(t[0])
  exit()
def gcd(x,y):
  if y==0:
    return x
  return gcd(y,x%y)
x=t[0]
for i in range(1,n):
  y=x*t[i]//gcd(x,t[i])
  x=y
print(y)

Solution (Python):
import sys

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

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


def main():
    input = sys.stdin.readline
    N = int(input())
    T = [int(input()) for _ in range(N)]
    T = sorted(T)

    t = T[0]
    for i in range(N):
        if T[i] % t == 0:
            t = T[i]
        else:
            t = lcm(t, T[i])

    return t


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

Solution (Python):
N = int(input())
tlist = [int(input()) for _ in range(N)]
def _gcd(x, y):
    x = abs(x)
    y = abs(y)
    while y:
        x, y =  y, x % y
    return x
def _lcm(x, y):
    x = abs(x)
    y = abs(y)
    return x * y // _gcd(x, y)
ans = 1
for t in tlist:
    ans = _lcm(ans , t)
print(ans)

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


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


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

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

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())
a = [1]
for _ in range(n):
    a.append(int(input()))
for i in range(1, n+1):
    a[i] = lcm(a[i-1], a[i])
print(a[-1])

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


def gcd(a, b):
    result = a
    k = 0
    n = b

    while True:
        k = result % n
        result = n
        n = k
        if k == 0:
            break

    return result


def lcm(a, b):
    g = gcd(a, b)

    return a * (b // g)


def main():
    ans = 1

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

    print(ans)
    return


main()

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

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

print(int(ans))

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


def gcd(a, b):
    result = a
    k = 0
    n = b

    while True:
        k = result % n
        result = n
        n = k
        if k == 0:
            break

    return result


def gcd_n(numbers):
    l = numbers[0]

    for i in range(len(numbers)):
        l = gcd(l, numbers[i])

    return l


def lcm(a, b):
    g = gcd(a, b)

    return a * (b // g)


def lcm_n(numbers):
    l = numbers[0]

    for i in range(len(numbers)):
        l = lcm(l, numbers[i])

    return l


def main():
    print(lcm_n(Tn))
    return


main()

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

from functools import reduce
from fractions import gcd

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

print(reduce(lcm,T))

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

def gcd(m,n):
  x = max(m,n)
  y = min(m,n)
  if x%y == 0:
    return y
  else:
    while x%y != 0:
      z = x%y
      x = y
      y = z
    else:
      return z

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

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

print(ans)

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

from functools import reduce
from fractions import gcd

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

print(reduce(lcm, T))

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

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



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

m=a[0]
for i in range(1,len(a)):
    m=lcm(m,a[i])

print(m)

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

Solution (Python):
def gojoho(a,b):
    a,b=max(a,b),min(a,b)
    while a%b!=0:
        a,b=b,a%b
    return b
def main(a,b):
    return (a*b)//gojoho(a,b)
N=int(input())
T=[int(input()) for i in range(N)]
T.sort(reverse=True)
ans=T[0]
for i in range(1,N):
    ans=main(ans,T[i])
print(ans)

Solution (Python):
import fractions


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


N = int(input())
T = [int(input()) for _ in range(N)]
ans = 1
for t in T:
    ans = lcm(ans, t)

print(ans)

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

T=list(set(T))
cnt=0
x=1
while True:
    x=lcm(x,T[cnt])
    cnt+=1
    if cnt==len(T):
        break

print(x)

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

Solution (Python):
import fractions
def lcm(a,b):
  return a*b//fractions.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):
def gcd(a: int, b: int) -> int:
    if a < b:
        a, b = b, a
    return a if b == 0 else gcd(b, a % b)


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


def multiple_clocks(N: int, T: list) -> int:
    ans = 1
    for t in T:
        ans = lcm(ans, t)
    return ans


if __name__ == "__main__":
    N = int(input())
    T = [int(input()) for _ in range(N)]
    ans = multiple_clocks(N, T)
    print(ans)

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

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

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

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

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

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


k=A[0]
for i in A[1:]:
  k=lcm(k,i)
print(k)

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

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

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)
ans = reduce(lcm, T)
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
    else:
        return gcd(b,a%b)
      
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):
from fractions import gcd
from functools import reduce

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


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


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


print(lcm_multi(T))

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

Solution (Python):

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

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

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


import functools
result_lcm = functools.reduce(lcm, a)

print(result_lcm)

Solution (Python):
N = int(input())
T1 = int(input())
if N == 1:
    print(T1)
else:
    ans = T1
    T = T1
    for i in range(N - 1):
        T2 = int(input())
        a = ans
        b = T2
        a, b = sorted([a, b])
        while True:
            if b % a == 0:
                break
            else:
                a, b = b % a, a
        ans = int(ans * T2 // abs(a))

    print(ans)

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

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

def lcm(i,j):
    return i*j // gcd(i,j)

print(reduce(lcm,T))

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

def gcd(m, n):
  while n:
    m, n = n, m%n
  return m

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

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

Solution (Python):
def gcd(a, b):
    a, b = max(a, b), min(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 = int(input())
    ans = 1
    for _ in range(N):
        t = int(input())
        ans = lcm(ans, t)
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
def gcd(a,b):
  a = int(a)
  b = int(b)
  r = (int)(a%b)
  while(r!=0):
    a=(int)(b)
    b=(int)(r)
    r=(int)(a%b)
  return b
def lcm(a,b):
    return int((a*b)//gcd(a,b))
n = int(input())
ans = int(input())
for i in range(n-1):
  num = int(input())
  ans = lcm(max(ans,num),min(ans,num))
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_list(numbers):
    return reduce(lcm_base, numbers)
  
n = int(input())
t = [int(input()) for i in range(n)]
print(lcm_list(t))

Solution (Python):
def GCD(x: int, y: int):
    if x < y:
        x, y = y, x

    if x % y == 0:
        return y
    else:
        return GCD(y, x % y)


def LCM(x: int, y: int):
    return x * y // GCD(x, y)


N = int(input())
Tlist = [int(input()) for i in range(N)]
ans = 1
for num in Tlist:
    ans = LCM(ans, num)
print(ans)

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007


def gcd(a,b):
    if a == 0:
        return b
    return gcd(b%a,a)
n = I()
a = IR(n)
l = a[0]
for i in range(1,n):
    g = gcd(l,a[i])
    l *= a[i]//g
print(l)

Solution (Python):
import fractions
from functools import reduce
def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

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

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

print(lcm_list(a))

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

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

if N==1:
  print(time[0])
else:
  tmp = time[0]*time[1]//gcd(time[0],time[1])
  for i in time:
    if tmp%i!=0:
      tmp = tmp*i//gcd(tmp,i)

  print(tmp)

Solution (Python):
from functools import reduce

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

def solve(t):
    return reduce(lcm, t, 1)

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

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

main()

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

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


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

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

k=T[0]

for i in T:
  k=lcm(k,i)
print(k)

Solution (Python):

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

def GCD(a,b): 
	x = max(a,b)
	y = min(a,b)
	if x % y == 0:
		return y
	else:
		while x % y != 0:
			z = x % y
			x = y
			y = z
		else:
			return y
def LCM(a,b): 
	return a * b // GCD(a,b)
x=T[0]
for t in T:
	x=LCM(x,t)
print(x)

Solution (Python):
import fractions
import functools

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

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

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

if N == 1: print( T[0] )
else     : print( lcm_list(T) )

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

def lcm(x,y):
    return (x*y)//gcd(x,y)
def lcm_list(numbers):
    return reduce(lcm,numbers,1)
if n==1:
    print(l[0])
else:
    print(lcm_list(l))

Solution (Python):
from fractions import gcd
n=int(input())
l=[int(input()) for i in range(n)]
if n==1:
    print(l[0])
elif n==2:
    x=gcd(l[0],l[1])
    print(l[0]*l[1]//x)
else:
    g=gcd(l[0],l[1])
    lcm=l[0]*l[1]//g
    for i in range(2,n):
        g=gcd(lcm,l[i])
        lcm=lcm*l[i]//g
    print(lcm)

Solution (Python):

import sys
import copy

def main():
	num = int(input())
	
	clocks = []
	for _ in range(num):
		clock = int(input())
		clocks.append(clock)
		
	ans = 1
	for clock in clocks:
		ans = lcm(ans, clock)
	print(ans)
			
def gcd(a, b):
	if a > b:
		a, b = b, a
		
	while a > 0:
		a, b = b % a, a
	return b
	
def lcm(a, b):
	g = gcd(a, b)
	return a // g * b
	
if __name__ == "__main__":
	main()

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

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

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

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

def lcm(A, n):
    if n == 2:
        return A[0]* (A[1] // gcd(A[0], A[1]))
    
    rec = lcm(A, n-1)
    return rec * (A[n-1] // gcd(rec, A[n-1]))

n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
if n >= 2:
    ans = lcm(a, n)
else:
    ans = a[0]
print(str(ans))

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








n = int(input())

T1 = int(input())
for i in range(n-1):
    T2 = int(input())
    T1 = T1*T2 // gcd(T1, T2)
    


print(str(T1))

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

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

Solution (Python):
def gcd(a,b):
    if b==0:
        return a
    else:
        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 //= gcd(Ans,T[i])
    Ans *= T[i]

print(Ans)

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

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

for i in range(n-1):
    if i == 0:
        b = lcm(a[i],a[i+1])
    else:
        b = lcm(b,a[i+1])
print(b)

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

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

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):
import sys
input = sys.stdin.readline
from fractions import gcd
from functools import reduce
n = int(input())
num = [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(num))

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

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
t=[]
for i in range(int(input())):
  t.append(int(input()))
print(lcm(*t))

Solution (Python):

N = int(input())
T = [int( input() ) for _ in range(N)]
T = set(T)
from functools import reduce
def gcd(x, y):
    while y != 0:
        (x, y) = (y, x % y)
    return x
    

def gcp (x,y):
    return x*y //gcd(x,y)
print(reduce(gcp, T))

Solution (Python):


import itertools
import collections
from bisect import bisect


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


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


def main():
    N = int(input())

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


if __name__ == '__main__':
    main()

Solution (Python):
from functools import reduce

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

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

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

def lcm_ans(LIST):
    return reduce(lambda a, b: (a*b)//gcd(a, b), t)

print(lcm_ans(t))

Solution (Python):
def c_multiple_clocks(N, T):
    from fractions import gcd
    from functools import reduce
    return reduce(lambda a, b: (a * b) // gcd(a, b), T)

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

print(ans)

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


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

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

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

t = list(set(t))

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

if len(t)==1:
  print(t[0])
  exit()
  
koubai = t[0]
for i in range(1,len(t)):
  kouyakusuu = gcd(koubai,t[i])   
  koubai = koubai*t[i]//kouyakusuu
print(koubai)

Solution (Python):
import fractions as math

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

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

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

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

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

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

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

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

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

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

N = input()
lcm_num = 1
for _ in range(N):
  t = input()
  lcm_num = lcm(lcm_num, t)

print lcm_num

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

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

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

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

Solution (Python):
from fractions import gcd

n = int(input())
t = sorted([int(input()) for _ in range(n)])
 
result = t.pop(0)

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

for timer in t:
	result = lcm(result, timer)
    
print(result)

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

def gcd(m, n):
  while n:
    m, n = n, m%n
  return m

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

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

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

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

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

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

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

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

@lru_cache(maxsize=None)
def lcm(a, b):
    return a*b//gcd(a, b)

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

print(t)

Solution (Python):



















from collections import defaultdict, Counter
import math
from bisect import bisect_left, bisect_right
import numpy as np


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


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


def lcmlist(numbers):
    a = numbers[0]
    for i in range(1, len(numbers)):
        a = lcm(a, numbers[i])
    return int(a)


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

print(lcmlist(t))

Solution (Python):
from fractions import gcd

res = 0
n = int(input())
for i in range(n):
    if i == 0:
        res = int(input())
    else:
        tmp = int(input())
        res = res*tmp//gcd(res, tmp)
print(res)

Solution (Python):
N = int(input())
L = []
for _ in range(N):
    L.append(int(input()))
def lcm(x, y):
    if x > y:
        x,y = y,x
    if x == 0:
        return y
    r = y % x
    return lcm(r,x)
def gcd(x,y):   
    return   x*y // lcm(x,y)

ans = L[0]
for x in L:
    ans = gcd(ans,x)
print(ans)

Solution (Python):
N = int(input())
L = []
for _ in range(N):
    L.append(int(input()))
def lcm(x, y):
    if x > y:
        x,y = y,x
    if x == 0:
        return y
    r = y % x
    return lcm(r,x)
def gcd(x,y):   
    return   x*y // lcm(x,y)

ans = L[0]
for x in L:
    ans = gcd(ans,x)
print(ans)

Solution (Python):
from functools import reduce
n=int(input())
data=[]
for i in range(n):
    data.append(int(input()))
def gcd(a, b):
    while a != 0:
        a, b = b%a, a
    return b
def lcm(x, y):
    return (x * y) // gcd(x, y)
print(reduce(lcm,data))

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

from functools import reduce

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x
    
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):
from fractions import gcd
N = int(input())
A = set()
for i in range(N):
    A.add(int(input()))
A = sorted(list(A), reverse=True)
while len(A) != 1:
    a = A.pop()
    b = A.pop()
    A.append(a//gcd(a,b)*b)

print(A[0])

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)

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

print(ans)

Solution (Python):

N=int(input())
T=[]
for i in range(0,N):
    T.append(int(input()))
def gcd(a,b):
    while b>0 :
        a0=a
        b0=b
        a=b0
        b=a0%b0
    return a
def lcm_base(x,y):
    return (x*y)//gcd(x,y)
def lcm_reduce(T):
    result=T[0]
    for i in range(1,len(T)):
        result=lcm_base(result,T[i])
    return result
print(lcm_reduce(T))

Solution (Python):


import sys


INF = float('inf')
MOD = 10 ** 9 + 7

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 LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()



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



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


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

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

print(ans)

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

def gcd(m,n):
    if n == 0:
        return m
    return gcd(n,m%n)
    
def lcm(m,n):
    return m * n//gcd(m,n)

print(reduce(lcm,T))

Solution (Python):
from functools import reduce


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

Solution (Python):

def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()

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

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

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

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

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

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

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

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

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)

if n==1:
    print(t[0])
else:
    ans=lcm(t[0],t[1])
    for i in range(n-1):
        ans=lcm(ans,lcm(t[i],t[i+1]))
    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 = []
for i in range(N):
    T.append(int(input()))

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

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

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

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

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

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

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

from functools import reduce
ans = reduce(lcm, li, 1)

print(ans)

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

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

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

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

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

Solution (Python):


def main():
    n = int(input())
    tn = [int(input()) for i in range(n)]
    print(lcm(tn))

def lcm(li):
    res = 1
    for x in li:
        res *= (x // gcd(res, x))
    return res

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

main()