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):
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 k in range(N):
    ans = lcm(ans, int(input()))

print(ans)

Solution (Python):


n = int(input())

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

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

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

print(ans)

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

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

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

for i in tt:
    p = []
    p.append(int(ss))
    p.append(int(i))
    q = list(sorted(p))
    while q[1] % q[0] != 0:
        r = [q[1] % q[0] , q[0]]
        s = list(sorted(r))
        q[0] = int(s[0])
        q[1] = int(s[1])

        
    ss = int(ss * i) // q[0]

print(ss)

Solution (Python):
def f(a,b):
    x,y=a,b
    while b>0:
        a,b=b,a%b
    return (x//a)*y
s=1    
N=int(input())
for i in range(N):
    a=s
    b=int(input())
    s=f(a,b)
print(s)

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

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

    ans = 1
    for x in T:
        ans = lcm(ans, x)
    return ans

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

Solution (Python):
import functools

def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)
def lcm_base(x, y):
    return (x * y) // gcd(x, y)

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

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



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

Solution (Python):
import sys
if sys.version_info < (3, 5):
    from fractions import gcd
else:
    from math import gcd

def lcm(a, b):
    if a == 0 or b == 0:
        return 0
    return int(a * b // gcd(a, b))

def solve():
    n = int(input())
    tl = [int(input()) for _ in range(n)]
    ans = tl[0]
    for elem in tl[1:]:
        ans = lcm(ans, elem)
    print(ans)
 
if __name__=="__main__":
    solve()

Solution (Python):
from fractions import gcd

def lcm(a, b):
    if a == 0 or b == 0:
        return 0
    return int(a * b // gcd(a, b))
  
def solve():
    n = int(input())
    tl = [int(input()) for _ in range(n)]
    ans = tl[0]
    for elem in tl[1:]:
        ans = lcm(ans, elem)
    print(ans)
 
if __name__=="__main__":
    solve()

Solution (Python):
from fractions import gcd

def lcm(a, b):
    if a == 0 or b == 0:
        return 0
    return int(a * b // gcd(a, b))
  
def solve():
    n = int(input())
    tl = [int(input()) for _ in range(n)]
    ans = tl[0]
    for elem in tl[1:]:
        ans = lcm(ans, elem)
    print(ans)
 
if __name__=="__main__":
    solve()

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

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

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

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

print(ans)

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

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

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)


if __name__ == '__main__':
    t = [int(input()) for _ in range(int(input()))]
    print(reduce(lambda x, y: lcm(x, y), t))

Solution (Python):
def c_multiple_Clocks(N, T):
    def gcd(a, b):
        while b > 0:
            a, b = b, a % b
        return a

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

    ans = 1
    for x in T:
        ans = lcm(ans, x)
    return ans

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

Solution (Python):
import fractions

n = int(input())
a = 1
for _ in range(n):
    x = int(input())
    a = (a * x) // fractions.gcd(a, x)
print(a)

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

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

ans=1
N=int(input())
for i in range(N):
  a=int(input())
  ans=solve(ans,a)
print(ans)

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

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

Solution (Python):
n=int(input())
t=1
for i in range(n):
    s=int(input())
    if t>s: a,b=t,s
    else: a,b=s,t
    
    while b!=0:
        a, b = b, a%b
    t=t*s//a
print(t)

Solution (Python):
import functools
import math

def gcd(x,y):
    a,b = max(x,y), min(x,y)
    while b != 0:
        a,b = b,a%b

    return a

def lcm2(x,y):
    return x*y // gcd(x,y)
    
N = int(input())
T = []
for i in range(N):
    ti = int(input())
    T.append(ti)

result = 1
for t in T:
    result = lcm2(result, t)

print(result)

Solution (Python):
n=int(input())
def Euclid(a,b):
    if a<b:
        return Euclid(b,a)
    if a%b==0:
        return b
    return Euclid(b,a%b)

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

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

N = int(input())

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

print(ans)

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

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

n = int(input())
result = 1

for i in range(n):
  tmp = int(input())
  result = result*tmp//GoJoHo(result,tmp)
print(result)

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

tmp = int(input())
res = 0
if n == 1:
    print(tmp)
else:
    for i in range(n-1):
        tmp2 = int(input())
        res = lcm(tmp, tmp2)
        tmp = res
    print(res)

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

Solution (Python):
def calc_gcd (a, b) :
    p = a * b

    if a > b:
        a, b = b, a

    while b != 0:
        a, b = b, a % b

    return p // a


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

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

while len(T) > 1:
    T = [calc_gcd(T[0], T[1])] + T[2:]

print(T[0])

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

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

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

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

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

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

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

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

Solution (Python):
import sys
from functools import lru_cache
sys.setrecursionlimit(10000)



n=int(input())

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

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

print(x)

Solution (Python):
n = int(input())
t = [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)
    
l = 1
for i in t:
    l = lcm(l,i)

print(l)

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

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


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


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

print(S)

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())
if n==1:
    print(int(input()))
    exit()
ans=1
for i in range(n):
    ans=lcm(ans,int(input()))
print(int(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())
if n==1:
    print(int(input()))
    exit()
ans=1
for i in range(n):
    ans=lcm(ans,int(input()))
print(int(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 = list(int(input()) for i in range(n))
mxt = max(t)
ls = []
ans = 0
j = 0
mod_flag = False

for i in range(n):
    if not mxt == t[i] and not mxt % t[i] == 0:
        mod_flag = True
        ls.append(t[i])
        j+=1
    
if not mod_flag:
    ans = mxt

if ans == 0:
    ans += mxt
    for i in range(len(ls)):
        if not ans % ls[i] == 0:
            ans = lcm(ans,ls[i])
    
print(ans)

Solution (Python):
def koubai(a,b):
    if b==0:
        return a
    return(koubai(b,a%b))
def kouyaku(a,b):
    return a*b//koubai(a,b)

N=int(input())
if N==1:
    print(int(input()))
    exit()
ans=1
for i in range(N):
    ans=kouyaku(ans,int(input()))
print(int(ans))

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

def euclid_gcd(a, b):
    assert(a >= b)
    while b != 0:
        _, m = divmod(a, b)
        a, b = b, m
    return a


def lcm(a, b):
    if b > a:
        a, b = b, a
    assert(a >= b)
    gcd = euclid_gcd(a, b)
    return a*b//gcd

print(reduce(lcm, xs))

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

res = 1

for _ in range(n):
    x = int(input())
    res = lcm(res, x)

print(res)

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

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

def main():
	count = int(input())
	i = 0
	tmp = 1
	while(i < count):
		i += 1
		num = int(input())
		tmp = lcm(tmp,num)
	print(int(tmp))
if __name__ == '__main__':
	main()

Solution (Python):

import sys
import collections
import math
import fractions 


raw_input = input


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

def main():
	count = int(input())
	i = 0
	temp = 1
	while(i<count):
		i+=1
		num = int(input())
		temp = lcm(temp,num)
	print(int(temp))


if __name__ == '__main__':
    main()

Solution (Python):
from functools import reduce









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

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

  ans = int(reduce((lambda x, y: lcm(x, y)), li))
  if ans > 1000000000000000000:
    ans = 1000000000000000000
  print(ans)

if __name__ == "__main__":
  main()

Solution (Python):
import fractions

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


N = int(raw_input())
T = [int(raw_input()) for _ in xrange(N)]

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

print ans

Solution (Python):


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

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

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

Solution (Python):
from fractions import gcd

N = int(input())
T = [int(input()) for i in range(N)]
ans = T[0]
def lcm(a, b):
    g = gcd(a, b)
    return a * b // g

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

Solution (Python):
import fractions

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

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

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

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

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

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

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

print(int(ans))

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


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

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_list = []
result = 1
for t in range(n):
    result = lcm(result,int(input()))
print(result)

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 i in range(N)]
ans = 1

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

print(ans)

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

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

print(ans)

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

p = a[0] 

for i in range(N-1):
    t = lcm(p, a[i+1])
    p = t

print(p)

Solution (Python):
def greatest_common_divisor(a, b):
    while b > 0:
        a, b = b, a % b
    return a


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

Solution (Python):
def greatest_common_divisor(a, b):
    while b > 0:
        a, b = b, a % b
    return a


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

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)

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

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


print(ans)

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

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

Solution (Python):

import math
import sys
import itertools
import numpy as np
import functools
import collections
mo = 1000000007
INF = 10**100
r = range

class infix(object):
    def __init__(self, function):
        self.function = function

    def __ror__(self, other):
        self.left = other
        return self

    def __or__(self, other):
        return self.function(self.left, other)

    def __call__(self, value1, value2):
        return self.function(value1, value2)

@infix
def c(f_t_u, f_u_r): return lambda t: f_u_r(f_t_u(t))

class _Ap(object):
    def __rlshift__(self, other):
        self.value = other
        return self

    def __rshift__(self, other):
        return other(self.value)
Ap = _Ap()
A = Ap




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

n=input()<<A>>int
ret = 1
for i in range(n): a=int(input()); ret = ret * a // gcd(ret, a)
print(ret);

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 T:
    l = lcm(l, i)

print(l)

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(raw_input())
T = [int(raw_input()) for i in xrange(N)]

print reduce(lcm, T)

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

Solution (Python):
from sys import stdin, stdout
def readAll_int(): return list(map(int, stdin))

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

def main():
    n = int(input())
    t = list(set(readAll_int()))
    if len(t)>1:
        for i in range(len(t) - 1):
            a = lcm(t[i], t[i+1])
            t[i+1] = a
    else:
        a = t[0]
    print(a)
    
if __name__ == "__main__":
    main()

Solution (Python):


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

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

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

ret = 1

for _ in range(N):
    ret = lcm(ret, int(input()))

print(ret)

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

ret = 1

for _ in range(N):
    ret = lcm(ret, int(input()))

print(ret)

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)

def lcm_multiple(*args):
    return reduce(lcm, args)

times = [int(raw_input()) for i in xrange(int(raw_input()))]
print lcm_multiple(*times)

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

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

N=int(input())
ans=1
for _ in range(N):
    t=int(input())
    ans=gcf(ans,t)
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/gcd(x, y)*y


N = int(raw_input())
T = [int(raw_input()) for _ in xrange(N)]
 
ans = 1
 
for i in T:
    ans = lcm(ans, i)
 
print ans

Solution (Python):
N = int(input())
T= [0]*N
for i in range(N):
    T[i] = int(input())
T.sort(reverse=True)
def gcd(n,m):
    while m > 0:
        n , m = m , n%m
    return n
def lcm(n,m):
     x = n*m//gcd(n,m)
     return x
for i in range(N-1):
    T[i+1] = lcm(T[i],T[i+1])
print(T[N-1])

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

Solution (Python):
def euclid(a,b):
	if b == 0:
		return a
	else:
		return euclid(b,a % b)
		
n = int(input())
t = []
for i in range(n):
	x = int(input())
	t.append(x)

for i in range(0,n-1):
	t[i+1] = t[i] * t[i+1] // euclid(t[i],t[i+1])

print(int(t[n-1]))

Solution (Python):
from collections import defaultdict
from itertools import product, groupby
from math import pi
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = 10 ** 10



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


def main():
    N = int(input())
    t_list = list(sorted([int(input()) for _ in range(N)]))
    ans = 1
    for t in t_list:
        ans = lcm(ans, t)

    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
T = []
for _ 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)
if N == 1:
    print(T[0])
else:
    result = lcm(T[0],T[1])

    for x in range(2,N):
        result = lcm(result, T[x])

    print(result)

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

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

print(int(ans))

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

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

Solution (Python):

"""
"""


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


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


def solve(clocks):
    temp_lcm = clocks[0]
    for n in clocks[1:]:
        temp_lcm = lcm(temp_lcm, n)
    return temp_lcm


def main():
    N = int(input())
    clocks = [int(input()) for _ in range(N)]
    result = solve(clocks)
    print(result)


if __name__ == '__main__':
    main()

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

N = int(input())
t = [int(input()) for i in range(N)]
for i in range(N-1):
    t[i+1] = t[i]*t[i+1]//yuclid(t[i], t[i+1])

print(t[N - 1])

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

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

print(t[n - 1])

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

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


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

print(t[n - 1])

Solution (Python):
def GCD(a, b):
    if a > b:
        A = a
        B = b
    elif b > a:
        A = b
        B = a
    else:
        return a

    r = A % B
    while r != 0:
        A = B
        B = r
        r = A % B

    return B


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


def solve(): 
    while 1:
        try:
            n = int(input())
            T = []
            for _ in range(n):
                T.append(int(input()))

            l = T[0]
            for i in range(1, n):
                l = LCM(l, T[i])

            print(l)
        except:
            break
            
            
solve()

Solution (Python):
import sys

def scp(a, b):
    if b > a:
        tmp_a = a
        a = b
        b = tmp_a
    while b:
        r = a % b
        a = b
        b = r
    return a
    
    
    
    

N = int(raw_input())
array = []
for i in range(N):
    array.append(int(raw_input()))

array.sort()





result = array[0]
for i in array[1:]:
    result = result / scp(result, i) * i
print result

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

n = int(input())
clocks = []
for i in range(n):
    clocks.append(int(input()))
print(reduce(lambda x, y: (x * y) // gcd(x, y), clocks))

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

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

print(ans)

Solution (Python):
from fractions import gcd

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

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

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 T:
    l = lcm(l, i)

print(l)

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


res = T[0]
for t in T:
    res = lcm(res, t)

print(res)

Solution (Python):
A = int(input())
a = [input() for i in range(A)]
a = map(int,a)
a = sorted(a)

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(A-1):
    b=lcm(a[0],a[1])
    del a[0:2]
    a.insert(0,b)
print(a[0])

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(a,b)

n=int(input())
cur=0
if n==1:
    cur=int(input())
else:
    cur=lcm(int(input()),int(input()))
    for _ in range(n-2):
        cur = lcm(int(input()),cur)
print(cur)

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

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

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

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

T = sorted(T)
def gcd(a, b):
    while b > 0:
        t = a
        a = b
        b = t%b
    return(a)

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

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

print(LCM)

Solution (Python):
import decimal


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


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

    return a * b // g


if __name__ == '__main__':
    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):
    m = max(a,b)
    n = min(a,b)
    if n==0:
        return m
    return gcd(n, m%n)

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

N = input()
Ti = []

for i in range(int(N)):
    tmp = input()
    Ti.append(int(tmp))

ans_lcm = 1
for i in range(len(Ti)):
    ans_lcm = lcm(ans_lcm,Ti[i])
print(ans_lcm)

Solution (Python):
def gcd(x,y):
    a=max(x,y)
    b=min(x,y)
    return b if a%b==0 else gcd(b,a%b)
def lcm(x,y):
    return x*y//gcd(x,y)

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

Solution (Python):
def gcd(t, n):
    if n == 0:
        return t
    return gcd(n, t%n)


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


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


if __name__ == "__main__":
    main()

Solution (Python):

from functools import reduce
N = int(input())
ary = []
for i in range(N):
    tmp = input()
    ary.append(int(tmp))


def GCD(a, b):
    if a < b:
        a, b = b, a

    while b > 0:
        a, b = b, a % b
    return a


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


print(reduce(LCM, ary))

Solution (Python):


import fractions

N=int(input())
ans=1
for idx in range(0,N,1):
    T=int(input())
    ans=ans*T// fractions.gcd(ans,T)

print(ans)

Solution (Python):
N = int(input())
T = []
for _ in range(N):
    T.append(int(input()))
    
def gcd(a, b):
    while b:
        a, b = b, a%b   
    return a

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

Solution (Python):
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
    
def lcm(a, b):
    return a * b // gcd(a, b)
    
def main():
    N = int(input())
    T = []

    for i in range(N):
        T.append(int(input()))
    
    while len(T) > 1:
        T_tmp = []
        for i in range(1, len(T)):
            tmp = lcm(T[i-1], T[i])
            T_tmp.append(tmp)
        T = T_tmp
    
    print(T[0])
    
if __name__=="__main__":
    main()

Solution (Python):
def gcd(a, b):
    """Return greatest common divisor using Euclid's Algorithm."""
    while b:      
        a, b = b, a % b
    return a

def lcm(a, b):
    """Return lowest common multiple."""
    return a * b // gcd(a, b)

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

Solution (Python):
def gcd(a, b):
    a = int(a)
    b = int(b)
    m = int(0)
    while(b > 0):
        m = a 
        a = b
        b = m % a
    return a
    

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

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

Solution (Python):
from functools import reduce

def gcd(*numbers):
    from fractions import gcd
    return reduce(gcd, numbers)

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

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

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)