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

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

a = t_list[0]
for c in range(N-1):
	b = t_list[c+1]
	a =a*b//gcd(a,b)

print(a)

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

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

n = int(raw_input())
l = [int(raw_input()) for _ in range(n)]
print reduce(lcm, l)

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

n = int(input())

res = 1
for i in range(n):
    a = int(input())
    g = gcd(res, a)
    res = (res // g) * a

print(res)

Solution (Python):
import fractions
import numpy as np


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

def main():
    N = int(input())
    T = [int(input()) for _ in range(N)]
    res = 1
    for e in T:
        res = lcm(res, e)
    print(res)

if __name__ == '__main__':
    main()

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

key = t.pop(0)

while len(t) != 0:
    b = t.pop(0)
    key = lcm(key, b)

print key

Solution (Python):
import fractions
import functools

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

n=int(input())
t=[]
for i in range(n):
	t.append(int(input()))
ans=functools.reduce(lcm,t)
print(ans)

Solution (Python):
import fractions
import functools

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

n=int(input())
t=[]
for i in range(n):
	t.append(int(input()))
ans=functools.reduce(lcm,t)
print(ans)

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

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

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

    prod = l * m

    gcD = gcd(l,m)

    return (prod // gcD)

n = int(input().strip())

lcm = 1
for i in range(n):
    num = int(input().strip())
    lcm = lcmm(lcm,num)
    

print(lcm)

Solution (Python):
import fractions

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

n = int(input())

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

print(ans)

Solution (Python):
def calc(A,B):
    C = A * B
    while B != 0:
        A,B = B, A % B
    return C // A
    
N = int(input())
ans = 1
for i in range(N):
    ans = calc(ans, int(input()))
print(ans)

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

Solution (Python):

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

N = int(input())
T = [ int(input()) for tmp in range(N) ]
if len(T) > 1:
    a = T.pop()
    b = T.pop()
    lcm = a*b//euc(a,b)
    for tmp in T:
        lcm = tmp*lcm//euc(tmp,lcm)
    print(lcm)
else:
    print(T.pop())

Solution (Python):
'''
def gcd(a,b):
    if a<b:
     c=a
     a=b
     b=c

    c=a%b

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

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

def lcm(e,f):
    c=gcd(e,f)
    g=e*f
    return g//c



n=int(input())
t=[0]*n

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

ans=t[0]

for lop in range(1,n):
    ans=lcm(ans,t[lop])
print(int(ans))

Solution (Python):
'''
def gcd(a,b):
    if a<b:
     c=a
     a=b
     b=c

    c=a%b

    if c==0:
     return b
    else:
     return gcd(b,c)
'''

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

def lcm(e,f):
    c=gcd(e,f)
    g=e*f
    return g//c



n=int(input())
t=[0]*n

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

ans=t[0]

for lop in range(1,n):
    ans=lcm(ans,t[lop])
print(int(ans))

Solution (Python):

     
     
def gcd(m, n):
    return m if n == 0 else gcd(n, m % n)
     
     
def lcm(m, n):
    return m * n // gcd(m,n)
     
     
def main():
    n = int(input())
    t = []
    for i in range(n):
        tmp = int(input())
        t.append(tmp)
    ans = t[0]
    for i in t:
        ans = lcm(ans, i)
    print(ans)
     
     
if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
Ts = [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)
 
def solve(Ts):
    if len(Ts) == 1:
        print(Ts[0])
    
    else:
        Ts_temp = []
        for i in range(len(Ts)-1):
            Ts_temp.append(lcm(Ts[i], Ts[i+1]))
        solve(Ts_temp)
 
solve(Ts)

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())
Ts=[]
c=1
for i in range(N):
 c=lcm(c,int(input()))
print(int(c))

Solution (Python):
def gcd(x, y):
    while y != 0:
        x, y = y, x%y
    return x
    
def lcm(x, y):
    return x * y // gcd(x, y)
    
N = int(input())
T = []
for i in range(N):
    T.append(int(input()))
temp = T[0]
for i in range(N-1):
    temp = lcm(temp, T[i+1])
print(temp)

Solution (Python):
def gcd(x, y):
    y, x = sorted([x, y])
    while y > 0:
        t = y
        y = x % y
        x = t
    return x

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

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

print(lcm)

Solution (Python):
def gcd(a, b):
    """最大公約数(Greatest Common divisor)を求める.

    ユークリッドの互除法の実装.
    ああああ

    Parameters
    ----------
    a : int
        自然数.
    b : int
        自然数.

    Returns
    -------
    int
        最大公約数
    """
    while b:
        a, b = b, a % b
    return a

def lcm(a, b):
    """最小公約数(least common multiple)を求める.

    Parameters
    ----------
    a : int
        自然数.
    b : int
        自然数.

    Returns
    -------
    int
        最小公倍数
    """
    return a * b // gcd(a, b)

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

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

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

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

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


if x <= 10 ** 18:
    print(x)
else:
    print(10 ** 18)

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

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

lcm = 0
gcd = 0

for i in range(n):
    t = int(input())
    if(i == 0):
        lcm, gcd = t, t
        continue
    lcm = t
    r = gcd % t
    while(r!=0):
        lcm = r
        r = t % r
    gcd *= t
    gcd //= lcm
print(gcd)

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())
Ts = []
c = 1
for i in range(N):
    c = lcm(c, int(input()))
 
print(int(c))

Solution (Python):
import fractions

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

if n==1:
    print(a[0])
    exit()
elif n==2:
    g=fractions.gcd(a[0],a[1])
    print(a[0]*a[1]//g)
    exit()

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

    print(lcm)

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

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

T = int(raw_input())
if N == 1:
    print T
else:
    f = T
    for i in xrange(1, N):
        T = int(raw_input())
        g = gcd(f, T)
        f = f / g * T
    print f

Solution (Python):


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

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



def gcd(a, b):
	r = max(a, b) % min(a, b)
	


	if (r == 0):
		return min(a, b)

	else:
		return gcd(r, min(a, b))



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




def LCM(T):
	l = len(T)



	if(l == 1):
		return T[0]

	elif(l == 2):
		return lcm(T[0], T[1])



	T1, T2 = [], []

	for i in range(l // 2):
		T1.append(T[i])

	for j in range(l - l // 2):
		T2.append(T[j + l // 2])



	return lcm(LCM(T1), LCM(T2))



print(LCM(T))

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

sys.setrecursionlimit(10**7)
inf = 10**1
gosa = 1.0 / 10**9
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 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 main():
    n = I()
    a = [I() for _ in range(n)]
    t = a[0]
    for c in a[1:]:
        t = t * c // fractions.gcd(t,c)

    return t



print(main())

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):
cl = [int(input()) for i in range(int(input()))]
ans = 1

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 cl:
    ans = lcm(ans,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())
Ts = []
c = 1
for i in range(N):
    c = lcm(c, int(input()))

print(int(c))

Solution (Python):
from functools import reduce






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

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

N = int(input())
Ts = []
c = 1
for i in range(N):
    c = lcm(c, int(input()))

print(int(c))

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())
res=1
for i in xrange(n):
 temp=int(raw_input())
 res=lcm(res,temp)
print res

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

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

temp=1
for i in range(len(arr)):
    temp=lcm(temp,arr[i])
print(temp)

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

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

anser=1
for i in t:
    anser=lcm(anser,i)
print(anser)

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

total = int(input())
param_list = [int(input()) for i in range(total)]

result = param_list[0]
for i in range(1, total):
    result = lcm(result, param_list[i])

print(result)

Solution (Python):
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)
a=1
for _ in range(int(input())):
    a=lcm(a,int(input()))
print(a)

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

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


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


for i in range(0, N):
    num = int(input())
    result = lcm(result, num)
print(int(result))

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)

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

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

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

print(result)

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

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

print(V)

Solution (Python):
def uq(a,c):
    return c if a%c==0 else uq(c,a%c)

n=(int)(input())

result = 1

for j in range(0,n):
    f=(int)(input())
    result=((result//uq(result,f)))*f
    
print((int)(result))

Solution (Python):
from fractions import gcd

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

ans = 1
for i in T:
    ans = int(ans * i //gcd(ans, i))
print(ans)

Solution (Python):
import fractions
from functools import reduce

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


n = int(input())
a = list(map(int, [input() for _ in range(n)]))
print(reduce(lcm, a))

Solution (Python):
def lcm(a, b):
    ax = a
    bx = b
    if a<b:
        ax, bx = (bx, ax)
    while True:
        if ax%bx == 0:
            gcd = bx
            break
        else:
            c = bx
            bx = ax%bx
            ax = c
    return a*b // gcd

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

while True:    
    if n==1:
        print(lst[0])
        break
    lst2.append(lcm(lst[0], lst[1]))
    lst.pop(0)
    lst.pop(0)
    lst2.extend(lst)
    if len(lst2)==1:
        print(lst2[0])
        break
    lst.clear()
        
    lst.append(lcm(lst2[0], lst2[1]))
    lst2.pop(0)
    lst2.pop(0)
    lst.extend(lst2)
    if len(lst)==1:
        print(lst[0])
        break
    lst2.clear()

Solution (Python):
import functools

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

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

n = int(input())
print(functools.reduce(lcm, [int(input()) for i in range(n)]))

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

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

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

Solution (Python):
from fractions import gcd

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

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

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

print (ans)

Solution (Python):
def main():
    N = int(input().strip())
    res = int(input().strip())
    if N == 1:
        print(res)
        return
    for _ in range(1, N):
        t = int(input().strip())
        res = lcm(res, t)
    print(res)


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


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

if __name__ == '__main__':
    main()

Solution (Python):
def func(a,b):
    return a if b==0 else func(b,a%b)
n = int(input())
num = int(input())
for i in range(n-1):
    d = int(input())
    num = num*d//func(num,d)
print(num)

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

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

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

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

T.sort(reverse=True)
ans = 1
for i in T:
    ans = lcm(ans, i)
print(ans)

Solution (Python):
import math as m
from functools import reduce
n,T= int(input()),[]
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
for i in range(n):
    T.append(int(input()))
tmp = max(T)
for i in range(n):
    if tmp % T[i] != 0:
        tmp = T[i]//gcd(tmp, T[i])*tmp

print(tmp)

Solution (Python):
import sys




def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


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


def ppcm(a, b):
    return (a * b) // pgcd(a, b)


def main():
    n = read_int()
    t = [read_int() for i in range(n)]
    res = 1
    for i in t:
        res = ppcm(res, i)
    print(res)


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

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

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 = max(T)
for i in range(N):
    if tmp % T[i] != 0:
        tmp = T[i]//gcd(tmp, T[i])*tmp

print(int(tmp))

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

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

if max(T) > 5*10**17:
    print(max(T))
    
else:
    tmp = max(T)
    for i in range(N):
        if tmp % T[i] != 0:
            tmp = T[i]//gcd(tmp, T[i])*tmp

    print(int(tmp))

Solution (Python):

def gcd(a,b):
    if b>a:
        t=b
        b=a
        a=t
    a1=a
    b1=b
    while b1>0:
        r=a1%b1
        a1=b1
        b1=r
    a//=a1
    a*=b
    return a
N=int(input())
T=[int(input()) for i in range(N)]
if N==1:
    print (T[0])
else:
    m=gcd(T[0],T[1])
    i=2
    while i <N:
        m=gcd(m,T[i])
        i+=1
    print(m)

Solution (Python):


n = int(input()) 
t = sorted([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)
	
def nlcm(list):
  if len(list) > 2:
    lcm_num = lcm(list[0], list[1])
    for i in range(2, len(list)):
      lcm_num = lcm(lcm_num, list[i])
    
    print(lcm_num)
  elif len(list) == 2:
    print(lcm(list[0], list[1]))
  else:
  	print(list[-1])

nlcm(t)

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

if n == 1:
    print(k[0])
else:
    p = lcm(k[0],k[1])
    for i in range(n):
        p = lcm(p,k[i])
    print(int(p))

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)

a = T[0]

for Ti in T[1:]:
    a = lcm(a, Ti)

print(a)

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

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

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

Solution (Python):
def main():
    N = int(input())
    T = tuple(int(input()) for _ in range(N))

    lcm_ = T[0]
    for i in T:
        lcm_ = lcm(i, lcm_)

    print(lcm_)

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

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

main()

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




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)

def lcmm(*args):
    """Return lcm of args."""   
    return reduce(lcm, args)

print(lcmm(*data))

Solution (Python):
import sys
from collections import deque
import copy

from math import *
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

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

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

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [int(input_raw[0])]
    T = []
    for i in range(N):
        input_raw = read_func().strip().split()
        T.append(int(input_raw[0]))

    T.sort()

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


if __name__ == '__main__':
    main()

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

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

    N = x[0]
    lst = x[1:]
    if N == 1:
        return lst[0]
    else:
        l = lcm(lst[0], lst[1])
        for x in lst:
            l = lcm(l, x)
        return l

n = int(input())
t = [int(input()) for i in range(n)]
t.insert(0,n)
print(Q3(t))

Solution (Python):

def gcd(a, b):
    if a < b:
        c = a
        a = b
        b = c

    r = a % b

    while r > 0:
        a = b
        b = r
        r = a % b

    return b

    
    
    
    
    
    
    
    
    
    
    
    
    


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


ans = a[0]

for i in range(N):
    if i == 0:
        continue

    g = gcd(ans, a[i])
    ans = ans * a[i] // g

print(ans)

Solution (Python):



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

N = int(input())
T = sorted(set([int(input()) for x in range(N)]))
a = T[-1]
for i in T[:-1]:
    a = (a * i) // gcd(a, i)

print(a)

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

def nlcm(nums):
    d = 1
    for num in nums:
        d = lcm(d,num)
    return d
 
if __name__ == '__main__':
    N = int(input())
    nums = []
    for i in range(N):
        nums.append(int(input()))
 
    print(nlcm(nums))

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

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

def arrlcm(a):
    alen = len(a)
    if alen == 3:
        return lcm(a[0], lcm(a[1], a[2]))
    elif alen == 2:
        return lcm(a[0], a[1])
    elif alen == 1:
        return a[0] 
    elif alen == 0:
        return 0
    else:
        return lcm(arrlcm(a[:alen//2]), arrlcm(a[alen//2:]))

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


if __name__=="__main__":
    solve()

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

c()

Solution (Python):
N=int(input())
T=[]
for i in range(N):
    T.append(int(input()))
def gcd(a,b):
    if b>a:
        a,b=b,a
    while b>0:
        a,b=b,a%b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)
if N==1:
    print(T[0])
elif N==2:
    print(lcm(T[0],T[1]))
else:
    l=[T[0]]
    for i in range(N-1):
      l.append(lcm(l[i],T[i+1]))
    print(l[-1])

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

r = 1
nbClock = int(input())
for i in range(nbClock):
   c = int(input())
   g = gcd(r,c)
   r = r * (c//g)
print(r)

Solution (Python):

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

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

S = set(T)
res = 1
for j in S:
    res = res * j // gcd(res, j)
    
print(int(res))

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)


if __name__ == '__main__':
    N = int(input())
    T = []
    for i in range(N):
        T.append(int(input()))
    tmp = T[0]
    for j in range(N - 1):
        tmp = lcm(tmp, T[j+1])
    print(tmp)

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

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

for j in range(N):
  t[j+1] = lcm(t[j],t[j+1])
  
print(t[N])

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

n = int(input())

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

print(ans)

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)

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

print(ans)

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


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

print ans

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

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)

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

print(ans)

Solution (Python):



n = raw_input()
n = int(n)

t = []

for i in range(n):
    temp = raw_input()
    temp = int(temp)
    t.append(temp)

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

x = 1
for i in range(n):
    y = t[i]
    gcdxy = gcd(x,y)
    lcm = x*y/gcdxy
    x = lcm

print x

Solution (Python):
from functools import reduce

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

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

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

print(reduce(lcm,a))

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

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())
res = int(input())
for i in range(1, n):
    x = int(input())
    res = LCM(res, x)
print(res)

Solution (Python):

n = int(input())
t = [ int(input()) for i in range(n)]
def gcd(a,b):
    if a<b:a,b = b,a 
    if b==0:return a
    else : return gcd(b,a%b)    

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

def lcm(b):
    ans = b[0]
    for i in b:
        ans = lc(ans,i)
    return ans
print(lcm(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)

now = 0
time = int(input())
fi = 1
ans = 1
while now < time:
    thi = int(input())
    ans = lcm(ans, thi)
    now += 1
print(ans)

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

ret = 1
N = int(input())
for _ in range(N):
  T = int(input())
  p = pgcd(ret,T)
  ret *= (T//p)

print(ret)

Solution (Python):
def gcd(*numbers):
    """Return the greatest common divisor of the given integers"""
    from fractions import gcd
    return reduce(gcd, numbers)



def lcm(*numbers):
    """Return lowest common multiple."""    
    def lcm(a, b):
        return (a * b) // gcd(a, b)
    return reduce(lcm, numbers, 1)
l = []
for x in range(int(raw_input())):
	l.append(int(raw_input()))
ans = 1
for x in l:
	ans = lcm(ans,x)
print(ans)

Solution (Python):
n = int(input())
li = []

for i in range(n):
    a = int(input())
    li.append(a)
    
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

while len(li) > 1:
    a = li[0]
    b = li[1]
    li.pop(1)
    li.pop(0)
    ans = a * b // gcd(a, b)
    li.append(ans)

print(li[0])

Solution (Python):
from sys import stdin

def gcd(a, b):
  return a if b == 0 else gcd(b, a % b)
  
def lcm(a, b):
  return a * b // gcd(a,b)
  
N = int(input())
T = [int(t) for t in stdin]

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

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())
n_set = set([])

for i in range(n):
    tmp = int(input())
    n_set.add(tmp)

ans = 1
for i in range(len(list(n_set))):
    ans = lcm(ans, list(n_set)[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())
ls = []
for i in range(n):
    ls.append(int(input()))
result = ls[0]
for i in ls[1:]:
    result = lcm(i,result)
print(result)

Solution (Python):
def yu(a, b):
	sa = a
	sb = b
	while(True):
		if a < b:
			tm = a
			a = b
			b = tm
		a = a % b
		if a == 0:
			return (sa*sb)/b


n = input()
t = []
for i in range(n):
	t.append(input())
for  i in range(n - 1):
	m = yu(t[i], t[i+1])
	t[i+1] = m
print(t[n-1])

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

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

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

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

Solution (Python):
import fractions
import functools


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


N = int(input())
T = []
for i in range(N):
    T.append(int(input()))
res = functools.reduce(lcm, T)
print(res)

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