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())
import fractions
ans = 1
for _ in range(n):
    t = int(input())
    ans = ans * t // fractions.gcd(ans, t)
print(ans)

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    S=[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, S))
resolve()

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

from fractions import gcd
from functools import reduce
def lcm(x,y):return x*y//gcd(x,y)
ans=reduce(lcm,t)
print(ans)

Solution (Python):
from fractions import gcd
N=int(input())
def lcm(a,b):
    return a//gcd(a,b)*b
T=[]
for i in range(N):
    t=int(input())
    T.append(t)
a=1
for i in range(N):
    a=lcm(a,T[i])

print(a)

Solution (Python):
from fractions import gcd


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


N = int(input())

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

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

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

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

print(now)

Solution (Python):
from fractions import gcd
n = int(input())
t = list(int(input()) for _ in range(n))


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


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

print(ans)

Solution (Python):
def main():
    from functools import reduce

    N = int(input())

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

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

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


if __name__ == '__main__':
    main()

Solution (Python):
import math
import string
import collections
from collections import Counter
from collections import deque
from decimal import Decimal
import sys
import fractions


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


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor



dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]


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

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

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

n = int(input())
t = list(int(input()) for _ 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(t))

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = inp()
a = [inp() for _ in range(n)]
now = a[0]
for i in range(1,n):
    now = a[i]*now//fractions.gcd(a[i],now) 
print(now)

Solution (Python):
import fractions
n = int(input())
t = [int(input()) for _ in range(n)]
def lcm(a, b):
	return a*b//fractions.gcd(a, b)
if n == 1:
	print(t[0])
else:
	ans = lcm(t[0], t[1])
	for i in range(2, n):
		ans = lcm(ans, t[i])
	print(ans)

Solution (Python):
def gcd(x,y):
    while y>0:
        x,y = y,x%y
    return x
N = int(input())
T = [int(input()) for _ in range(N)]
ans = T[0]
for i in range(1,N):
    a = gcd(ans,T[i])
    ans = (ans//a)*T[i]
print(ans)

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

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



def resolve():
  n = int(input())
  t = []
  for i in range(n):
    t.append(int(input()))
  ans = 1
  for x in t:
    ans = lcm(x, ans)

  print(ans)
  return

if __name__ == "__main__":
  resolve()

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

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 9)
MOD = 10 ** 9 + 7

from fractions import gcd

N = int(input())

T = int(input())

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

print (T)

Solution (Python):
import fractions
def lcm(a):
    LCM = a[0]
    for i in range(1, n):
        LCM = LCM * a[i] // fractions.gcd(LCM, a[i])
    return LCM

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

print(lcm(t))

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

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7

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 resolve():
    n = int(input())
    T = list(int(input()) for _ in range(n))

    res = 1
    for i in range(n):
        res = lcm(res, T[i])

    print(res)


if __name__ == '__main__':
    resolve()

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    S=[]
    for i in range(n):
        S.append(int(input()))
    from functools import reduce
    from fractions import gcd

    def lcm(A, B):
        return A * B // gcd(A, B)


    print(reduce(lcm, S))
resolve()

Solution (Python):
import sys
from collections import Counter
from collections import deque
import heapq
import math
import fractions
import bisect
import itertools
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

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

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

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

N = int(input())
L = 1

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

print(L)

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

def main():
    
    readline=stdin.readline
    n=int(readline())
    t=[int(readline()) for _ in range(n)]

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

    print(ans)

if __name__=="__main__":
    main()

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

Solution (Python):
import fractions

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

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

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

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

Solution (Python):
import sys
from fractions import gcd
from functools import reduce
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

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

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

def main():
    N = int(readline())
    T = []
    for _ in range(N):
        T.append(int(readline()))
    ans = lcm_list(T)
    print(ans)
if __name__ == '__main__':
    main()

Solution (Python):
import fractions

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

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

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

def main():
    
    readline=stdin.readline
    n=int(readline())
    t=[int(readline()) for _ in range(n)]

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

    print(ans)

if __name__=="__main__":
    main()

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

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

lcm = lambda x,y:x//gcd(x,y)*y

ans=reduce(lcm,t)

print(ans)

Solution (Python):

"""
Created on Fri May 29 21:29:28 2020

@author: naoki
"""
import fractions

N = int(input()) 
T = [int(input()) for i in range(N)] 
T.sort() 
lcm = T[0] 

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

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

T = [int(input()) for _ in range(N)]
ans = T[0]
for e in T:
    ans = lcm(e,ans)
print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
n = int(input().rstrip())
seconds = [int(input().rstrip()) for _ in range(n)]


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

ans = 1
for num in seconds:
    ans = int(lcm(ans,num))
print(ans)

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

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

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

Solution (Python):
import fractions
N = int(input())
t = []
for i in range(N):
  t.append(int(input()))
  
lcm = 1

for i in range(N):
  lcm = lcm* t[i]// fractions.gcd(lcm, t[i])
  
print(lcm)

Solution (Python):

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

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

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

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

print(ans)

Solution (Python):
import fractions
def main():
    n = int(input())
    lcm = 1
    for _ in range(n):
        t = int(input())
        lcm = lcm * t //  fractions.gcd(lcm, t)
    print(lcm)


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

for i in range(n):
    t = int(input())
    if i != 0:
        ans = lcm(ans,t)
    else:
        ans = t
    
print(ans)

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

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

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

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

print(lcm_list(ab))

Solution (Python):
import fractions as math

n = int(input())

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

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

print(tmp)

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

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

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

Solution (Python):
import fractions

N=int(input())
T=[int(input()) for _ in range(N)]
ans=1
for i in range(N):
    ans=ans*T[i]//(fractions.gcd(ans,T[i]))
print(ans)

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

Solution (Python):
import fractions

n=int(input())

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

print(lcm)

Solution (Python):
import sys
import fractions


def input():
    return sys.stdin.readline()[:-1]


N = int(input())
ans = 0
for _ in range(N):
    if ans == 0:
        ans = int(input())
    else:
        t = int(input())
        ans = (ans * t) // fractions.gcd(ans, t)
print(ans)

Solution (Python):

import re
import math
from collections import defaultdict
from collections import deque
import collections
from fractions import Fraction
import fractions
import itertools
from copy import deepcopy
import random
import time
import os
import queue
import sys
import datetime
from functools import lru_cache

readline=sys.stdin.readline
sys.setrecursionlimit(2000000)

alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class unionfind():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(n)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):
            self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def ispow(a,b):
    now=b
    while now<a:
        now*=b
    if now==a:return True
    else:return False
def getbin(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def getfacs(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod_>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def nextcomb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:return num
def getprimes(n,type="int"):
    if n==0:
        if type=="int":return []
        else:return [False]
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def isprime(num):
    if(num<=1):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def ifelse(a,b,c):
    if a:return b
    else:return  c
def join(A,c=""):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s
def factorize(n,type_="dict"):
    b = 2
    list_ = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            list_.append(b)
        b+=1
    if n > 1:list_.append(n)
    if type_=="dict":
        dic={}
        for a in list_:
            if a in dic:
                dic[a]+=1
            else:
                dic[a]=1
        return dic
    elif type_=="list":
        return list_
    else:
        return None
def pm(x):
    return x//abs(x)
def inputintlist(): 
    return list(map(int,input().split()))
def istanchouzouka(A):
    f=True
    prev=min(A)-1
    for a in A:
        if prev>=a:
            f=False
        prev=a
    return f
def istanchouhigensyou(A):
    f=True
    prev=min(A)-1
    for a in A:
        if prev>a:
            f=False
        prev=a
    return f
def getallsum(A):
    s=sum(A)
    dp=defaultdict(int)
    dp[0]=1
    for a in range(0,len(A)):
        for b in range(s,-1,-1):
            if b-A[a]>=0:
                dp[b]+=dp[b-A[a]]
    return dp
def lcm(a,b):
    return a*b//fractions.gcd(a,b)




n=int(input())
T=[0]*n
for a in range(n):
    T[a]=int(input())
g=T[0]
for a in T:
    g=lcm(a,g)
print(g)

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

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

n = int(input())
t = [int(input()) for _ in range(n)]
if n == 1:
    print(t[0])
else:
    l = lcm(t[0], t[1])
    for i in range(1, n):
        l = lcm(l, t[i])
    print(l)

Solution (Python):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))

from fractions import gcd

n = ii()
l = []
for _ in range(n):
    l.append(ii())

commul = l[0]
for i in l:
    commul = (commul*i)//gcd(commul,i)
print(commul)

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

import fractions

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

Solution (Python):
from fractions import gcd
N = int(input())
if N >=2:
    A = [int(input()) for _ in range(N)]
    B = [0]*(N-1)
    B[0] = (A[0]*A[1])//gcd(A[0], A[1])
    for i in range(N-2):
        B[i+1] = (A[i+2]*B[i])//gcd(A[i+2], B[i])
    ans = B[N-2]
else:
    ans = int(input())
print(ans)

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

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

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

import math
import fractions
from functools import reduce

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

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

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

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

n = int(input())
T = set()
ans = 1
for i in range(n):
    T.add(int(input()))
print(lcm(list(T)))

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

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

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

curr = t[0]
for i in t[1:]:
    curr = curr * i // gcd(curr, i)

print(curr)

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

Solution (Python):


import sys


























from fractions import gcd                    



def main():
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    def lcm(a,b):return a*b // gcd(a,b)
    
    
    n = ii()
    L = [ii() for _ in range(n)]
    l = L[0]
    for i in range(1, n):
        l = lcm(l, L[i])
    print(l)


if __name__ == "__main__":
    main()

Solution (Python):
def gcd(x,y):
  x,y = max(x,y),min(x,y)
  while x%y != 0:
    x,y = y,x%y
  return y

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

N = int(input())
lst = []
res = None 
for _ in range(N):
  n = int(input())
  if res is None:
    res = n
  else:
    res = lcm(res, n)

print(res)

Solution (Python):






import sys
input = sys.stdin.readline

import math

import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache






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






def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]


def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()


def DD(arg): return defaultdict(arg)



def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr


def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors


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


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


def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count


def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i])*n**i for i in range(len(str(X))))


def int_log(n, a):
  count = 0
  while n>=a:
    n = n//a
    count += 1
  if a**count == n:
    return count
  else:
    return count+1





N = I()
T = ILs(N)

ans = T[0]

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

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

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

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

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



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):
import fractions
n=int(input())
a=[int(input()) for i in range(n)]
p=a[0]
for x in a:
    p=p*x//fractions.gcd(p,x)
print(p)

Solution (Python):

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

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

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

Solution (Python):
from fractions import gcd
n,*t = map(int,open(0).read().split())

x = t.pop(0)
for i in range(len(t)):
    x = x*t[i]//gcd(x,t[i])
print(x)

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

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

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

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

ans = lcm(*T)
print(ans)

Solution (Python):
import fractions
from functools import reduce

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

ans = reduce(lambda x, y: x * y // fractions.gcd(x, y), t)
print(ans)

Solution (Python):
from fractions import gcd

n = int(input())
t_l = [int(input()) for nesya in range(n)]
ans = t_l[0]
for t in t_l:
  ans = ans*t//gcd(ans,t)
print(ans)

Solution (Python):

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


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

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

lcm_calc = T[0]

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

print(lcm_calc)

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

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

Solution (Python):


from functools import reduce
from fractions import gcd 


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

def multi_lcm(numbers):
    return reduce(lcm_base, numbers)

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

print(multi_lcm(t_list))

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

ans = li[0]
for i in range(1,n):
    s = li[i]
    ans = (ans * s) // fractions.gcd(ans, s)

print(ans)

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

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

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

def lcm2(args):
    return reduce(lcm,args)

print(lcm2(t))

Solution (Python):
import fractions 

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

N = int(input())
t = int(input())

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

Solution (Python):
import fractions
from functools import reduce
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

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

def myAnswer(N:int,T:list) -> int:
   return lcm_list(T)

def modelAnswer():
   return
def main():
   N = int(input())
   T = [int(input()) for _ in range(N)]
   print(myAnswer(N,T))
if __name__ == '__main__':
   main()

Solution (Python):
import fractions
from functools import reduce
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

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

def myAnswer(N:int,T:list) -> int:
   return lcm_list(T)

def modelAnswer():
   return
def main():
   N = int(input())
   T = [int(input()) for _ in range(N)]
   print(myAnswer(N,T))
if __name__ == '__main__':
   main()

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

Solution (Python):
import sys
import os
import math
import bisect
import collections
import itertools
import heapq
import re
import queue
import fractions

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

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


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    T = [ii() for _ in range(N)]

    ret = lcm(T[0], T[1]) if len(T) > 1 else T[0]
    for t in T:
        ret = lcm(ret, t)
    print(ret)


if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
from fractions import gcd
n = int(input())
ans = 1
lcm = lambda x, y: x*y // gcd(x, y)
for i in range(n):
    m = int(input())
    ans = lcm(ans, m)
print(ans)

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 l_lcm(num):
    return reduce(lcm, num, 1)

print(l_lcm(t))