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())
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>0:
		a,b=b,a%b
	return a

n=int(input())
a=[0]*n
for i in range(n):
	a[i]=int(input())
if n==1:
	print(a[0])
else:
	r = a[0]*a[1]//gcd(a[0],a[1])
	for i in range(2,n):
		r = r * (a[i]//gcd(r,a[i]))
	print(int(r))

Solution (Python):
import sys

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())
if(N==1):
    print(int(input()))
    sys.exit()

T=[]
T.append(int(input()))

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

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

def lcm(a, b): 
    return abs(a * b) // gcd(a,b)
I = [int(input()) for n in range(N)]
print(int(reduce(lcm, I, 1)))

Solution (Python):
N = int(input())
 
a_list = []
for _ in range(N):
    a_list.append(int(input()))
 
def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)
 
res = 1
for i in range(N):
    d = gcd(res, a_list[i])
    res = res // d
    res = res * a_list[i]
 
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 = int(input())
l = int(input())

i = 1

while i < n:
    l = lcm(l, int(input()))
    i = i + 1

print(l)

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

def lcm(x, y):
    M = x * y
    if x < y:
        x, y = y, x
    while y > 0:
        x, y = y, x % y
    return M // x
num = []
for _ in range(N):
    num.append(int(input()))
M = num[0]
for i in range(N):
    M = lcm(M, num[i])
print(M)

Solution (Python):
def gcd(m,n):
  if n == 0:
    return m
  else:
    r = m % n
    return gcd(n,r)
  
def LCM(num1,num2):
  return (num1/gcd(num2,num1))*num2

N = input()
l = []
for i in range(N):
  l.append(input())
l.sort()
lcm = l[N-1]
for i in range(N-1):
  lcm = LCM(l[N-2-i],lcm)
print lcm

Solution (Python):
n = int(input())
res = 1
def gcd(x, y):
    if x % y == 0:
        return y
    return gcd(y, x %y)
for i in range(n):
    x = int(input())
    res = res * x // gcd(res, x)
print(res)

Solution (Python):
def gcd(a,b):
	if b==0:
		return a
	return gcd(b,a%b)
n= int(raw_input())
a=[]
g=0
h=1
for i in range(n):
	x=int(raw_input())
	a.append(x)
h=a[0]
for i in a:
	
	h=(h*i)/gcd(h,i)
print h

Solution (Python):
from fractions import gcd
n = int(input())
x = 1

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

print(x)

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):
n = int(raw_input())

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

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

print x

Solution (Python):
N = input();

from fractions import gcd

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

print ans

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

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

Solution (Python):

from functools import reduce


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

    return a


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


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

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

    print(reduce(lcm, ts))


if __name__ == "__main__":
    main()

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

from fractions import gcd

n=int(input())

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

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)

ans = 1

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

print(ans)

Solution (Python):


import fractions
import random
import sys

if __name__ == '__main__':
    def _(f):
        for l in f:
            for i in l.split():
                yield int(i)

    g = _(sys.stdin)

    N = next(g)

    lcm = 1

    for i in range(N):
        T = next(g)

        lcm = lcm * T // fractions.gcd(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)


N = int(input())						

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


print(a)

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

Solution (Python):

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


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


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


def read():
    N = II()
    T = [II() for __ in range(N)]
    return N, T


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


def main():
    params = read()
    print(solve(*params))


if __name__ == "__main__":
    main()

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(raw_input())
ans=-1
while n>0:
    n-=1
    if ans==-1:
        ans=int(raw_input())
    else:
        x=int(raw_input())
        ans=lcm(ans,x)
print ans

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

Solution (Python):

def ggt(a, b):
    if b == 0:
        return a

    return ggt(b, a % b)

N = int(input())

erg = int(input())

for i in range(N-1):
    t = int(input())

    g = ggt(erg, t)
    erg = (erg // g) * t

print(erg)

Solution (Python):
import fractions

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

ans = 1

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

print ans

Solution (Python):
import fractions

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

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

print(ans)

Solution (Python):
def gcd(a,b):
	if b==0:return a
	return gcd(b,a%b)
ans=1	
for i in range(int(input())):
	h=int(input())
	ans = ans*h // gcd(ans,h)	
print(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)

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

print(s)

Solution (Python):
def __gcd(x,y):
    while(y!=0):
        x,y=y,x%y
    return x

def __lcm(x,y):
    g = __gcd(x,y)
    return (x//g)*y


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


a = L[0]
for i in range(1,n):
    a = __lcm(a,L[i])

print(a)

Solution (Python):
n=int(raw_input())
def gcd(a,b):
  if b==0 :
    return a
  return gcd(b,a%b)
y=1
for i in range(n) :
  x=int(raw_input())
  z=gcd(x,y)
  y=x*y/z
print y

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

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

print(x)

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

def gcd(m, n):
    while 1:
        mod = m % n
        if mod == 0:
            return n
        m, n = n, mod

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

from functools import reduce

print(reduce(lcm, ts))

Solution (Python):
from fractions import gcd


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


n = int(input())
ts = {int(input()) for _ in range(n)}
a = ts.pop()
for b in ts:
    a = lcm(a, b)
print(a)

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

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

def getlcm(a,b):
    return (a*b)/gcd(a,b)
    
n=int(raw_input(''))
x=int(raw_input(''))
lcm=x

for i in range(1,n,1):
    x=int(raw_input(''))
    lcm=getlcm(lcm,x)
print lcm

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

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

	out = reduce(lcm, nums)
	print(out)

if __name__ == '__main__':
	main()

Solution (Python):
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(input())
def pli(a): return "".join(list(map(str, a)))
def plis(a): return " ".join(list(map(str, a)))

import fractions


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

N = ri()
t = ri()
for i in range(N-1):
  t = lcm(t, ri())
print(t)

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

Solution (Python):
def HCF(a,b):
    if a==0:
        return b
    return HCF(b%a,a)
N = long(raw_input())
x = long(raw_input())
for i in range(1,N):
    y = long(raw_input())
    x = (x*y)/HCF(x,y)
print x

Solution (Python):
n=input()

a=[0 for i in range(n)]
def gcd(num1,num2):
    if num2 == 0:
        return num1
    else:
        return gcd(num2,num1%num2)

def lcm(num1,num2):
    tmp = gcd(num1,num2)
    return num1*num2/tmp

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

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

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

r = 1

for i in xrange(n):
    t = int(raw_input())
    cd = gcd(r, t)
    m = t // cd
    r *= m

print(r)

Solution (Python):
T=[]
for i in [None]*int(input()):
    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=1
for t in T:
    ans=lcm(ans,t)
print(ans)

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

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(raw_input())
t = [int(raw_input()) for _ in xrange(n)]
ans = 1
for i in xrange(n):
    ans = lcm(ans, t[i])
print ans

Solution (Python):
from fractions import gcd

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

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

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

print ans

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

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

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

Solution (Python):
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

def gcd(a, b):
    while(b > 0):
        c = a % b
        a = b; b = c
    return a

n = ni()
g = 0
for i in range(n):
    v = ni()
    if g == 0:
        g = v
    else:
        g = g//gcd(g,v)*v
print(g)

Solution (Python):
def gcd(x,y):
    if y==0:
        return x
    return gcd(y, x % y)
g = 1
for i in xrange(int(raw_input())):
    w = int(raw_input())
    g = g * w / gcd(g, w)
print g

Solution (Python):
def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n
def lcm(m, n):
    return m*n//gcd(m, n)
n = int(input())
ans = 1
for i in range(n):
    ans = lcm(ans, int(input()))
print("%d" % 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)