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):
import fractions
N = int(input())
D = [int(input()) for j in range(N)]
ANS = D[0]
for i in range(N-1):
    ANS = ANS * D[i+1] // fractions.gcd(ANS, D[i+1])
print(ANS)

Solution (Python):

import collections
import itertools as it
import math
import numpy as np
import functools
 

n  = int(input())


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



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

def multiple(a, b):
    return a*b // euclid(a, b)

def gcd(nums):
    return functools.reduce(euclid, nums)

def lcm(nums):
        return functools.reduce(multiple, nums)

print(lcm(t))

Solution (Python):


import fractions

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

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

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

Solution (Python):
from fractions import gcd 
import functools

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

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

print(functools.reduce(lcm,T))

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

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

Solution (Python):
from fractions import gcd

n = int(input())

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

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

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

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

Solution (Python):
import fractions


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


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

Solution (Python):

"""
Created on Thu May 14 12:02:56 2020

@author: shinba
"""
import math

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

n = int(input())

ans = 1

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

print(ans)

Solution (Python):
import math
from functools import reduce


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


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

print(reduce(lcm, clocks))

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

import math
from functools import reduce

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

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

print(lcm_list(t))

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

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

    def cal(a, b):
        t = a * b // gcd(a, b)
        return t

    n, *t = map(int, open(0).read().split())
    ans = reduce(cal, t)
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
def resolve():
	n = int(input())
	ans = int(input())
	for i in range(n-1):
		v = int(input())
		a = ans
		b = v
		r = a%b
		while r:
			a = b
			b = r
			r = a % b
		ans = ans * v // b
	print(ans)
resolve()

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

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    from fractions import gcd
    n = int(input())
    t = [int(input()) for _ in range(n)]

    ans = 1
    for elem in t:
        ans = (ans * elem) // gcd(ans, elem)

    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
import fractions

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

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

print(ans)

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

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

Solution (Python):
from fractions import gcd

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

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

ans = 1
for num in rows:
    ans = lcm(ans,num)

print(ans)

Solution (Python):
import sys
import re
import math
import collections
import decimal
import bisect
import itertools
import fractions
import functools
import copy





sys.setrecursionlimit(10000001)
INF = sys.maxsize
MOD = 10 ** 9 + 7

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




def main():
    n = ni()
    t=[]
    for _ in range(n):
        t.append(ni())


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

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

    print(lcm_list(t))


if __name__ == '__main__':
    main()

Solution (Python):
import fractions 

n = int(input())
a = int(input())
for i in range(n-1):
    b = int(input())
    f=fractions.gcd(a,b)
    a=a*b//f
print(a)

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
from fractions import gcd
from functools import reduce
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 = [0]*N
    for i in range(N):
        T[i] = int(readline())
    ans = lcm_list(T)
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
from fractions import gcd
from functools import reduce
def lcm(a, b):
    return a * b // gcd(a, b)
N = int(input())
print(reduce(lcm, tuple(int(input()) for _ in range(N))))

Solution (Python):
import fractions
from functools import reduce

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

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

def lcm(L):
    return reduce(lcm_base, L, 1)

print(lcm(T))

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

Solution (Python):
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a
N=int(input())
T=[int(input()) for i 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):
from statistics import median


from fractions import gcd
from itertools import combinations 
from collections import deque
from collections import defaultdict
import bisect










import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

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

def main():
    n = int(input())
    T = [int(input()) for _ in range(n)]
    g = 0
    lcm = 1
    for i in range(n):
        g = gcd(lcm,T[i])
        
        lcm = lcm // g * T[i]
    
    print(lcm)
if __name__ == '__main__':
  main()

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)

from functools import reduce

n,*a=map(int,open(0).read().split())

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

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

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

print(l)

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

Solution (Python):
from fractions import gcd

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

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

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

print(ans)

Solution (Python):
import sys
import fractions
import functools

N = int(sys.stdin.readline().rstrip())
T = []
for _ in range(N):
    T.append(int(sys.stdin.readline().rstrip()))

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

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

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

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

Solution (Python):
import fractions
def main():
    N = int(input())
    CLK = [int(input()) for i in range(N)]
    gcd = CLK[0]
    lcm = CLK[0]

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

    print(int(lcm))

if __name__ == "__main__":
    main()

Solution (Python):


N = int(input())



mod = 10 ** 9
from functools import reduce
from fractions import gcd

def main():
    T = sorted(list(set([int(input()) for _ in range(N)])))
    if len(T) == 1:
        print(T[0])
        exit()
    ans = (T[0] * T[1]) // gcd(T[0], T[1])
    for i in range(len(T) - 2):
        ans = (ans * T[i + 2]) // (gcd(ans, T[i + 2]))
    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
 
N = INT()
T = [INT() for _ in range(N)]

ans = 1

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

print(ans)

Solution (Python):
import fractions

from sys import stdin


def main():
    n = int(stdin.readline())
    t = [int(stdin.readline()) for _ in range(n)]
    dp = [0 for _ in range(n)]
    dp[0] = t[0]
    for i in range(1, n):
        dp[i] = t[i] * dp[i-1] // fractions.gcd(t[i], dp[i-1])
    print(dp[-1])


if __name__ == "__main__":
    main()

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


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


ans = t[0]
for x in t[1:]:
  ans = ans * x // gcd(ans, x)
print(ans)

Solution (Python):
def gcd(a, b):
	"""Compute the greatest common divisor of a and b"""
	while b > 0:
		a, b = b, a % b
	return a

def lcm(a, b):
	"""Compute the lowest common multiple of a and b"""
	return a * b // gcd(a, b)

def resolve():
	n = int(input())
	t = [int(input()) for _ in range(n)]
	ans = t[0]
	for i in t[1:]:
		ans = lcm(ans, i)
	print(ans)
resolve()

Solution (Python):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections

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

def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)
n = int(input())
T = [int(input()) for i in range(n)]
a = T[0]
for i in range(1,n):
    a = lcm(a,T[i])
print(a)

Solution (Python):
def gcd(a, b):
	"""Compute the greatest common divisor of a and b"""
	while b > 0:
		a, b = b, a % b
	return a

def lcm(a, b):
	"""Compute the lowest common multiple of a and b"""
	return a * b // gcd(a, b)

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

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

Solution (Python):
import sys
readline = sys.stdin.readline
from fractions import gcd

def main():
    N = int(readline())
    ans = 1
    for _ in range(N):
        t = int(readline())
        ans = (ans * t) // gcd(ans, t)
    
    print(ans)
    
if __name__ == '__main__':
    main()

Solution (Python):
import sys
readline = sys.stdin.readline
from fractions import gcd

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

def main():
    N = int(readline())
    ans = 1
    for _ in range(N):
        t = int(readline())
        ans = lcm_base(ans, t)
    
    print(ans)
    
if __name__ == '__main__':
    main()

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

Solution (Python):
def gcd(a, b):
	"""Compute the greatest common divisor of a and b"""
	while b > 0:
		a, b = b, a % b
	return a

def lcm(a, b):
	"""Compute the lowest common multiple of a and b"""
	return a * b // gcd(a, b)

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

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


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


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


if __name__ == '__main__':
    main()

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

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


answer=tlist[0]
for i in range(1,N):
  answer=answer*tlist[i]//fractions.gcd(answer,tlist[i])
  
print(answer)

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


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

def multiple(a, b):
    return a*b // euclid(a, b)

import functools




def lcm(nums):
        return functools.reduce(multiple, nums)

print(lcm(l))

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):
from fractions import gcd

n = int(input())

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

Solution (Python):
import fractions

N = int(input())

res = int(input())
for _ in range(N - 1):
    t = int(input())
    g = fractions.gcd(res, t)
    if t >= res:
        res = res * (t // g)
    else:
        res = (res // g) * t

print(res)

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

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

def main():
    n, *t = map(int, open(0).read().split())
    
    r = t[0]
    for i in range(1, n):
        num = gcd(r, t[i])
        r = num * (r // num) * (t[i] // num)
        
    print(r)

if __name__ == '__main__':
    main()

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


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

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

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

print(ans)

Solution (Python):
from fractions import gcd

def main():
    N=int(input())
    T=[int(input()) for i in range(N)]
    
    a=1
    for i in T:
        a=a*i//gcd(a,i)
    
    print(a)

if __name__=="__main__":
    main()

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

for i in range(n):
    s = int(input())
    l = s*l//gcd(s,l)
print(l)

Solution (Python):
from fractions import gcd

def nlcm(t):
    res = 1
    for a in t:
        res *= a // gcd(a,res)
    return res

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

print(nlcm(T))

Solution (Python):
def gcd(a, b):
    a, b = max([a, b]), min([a, b])
    if b == 0:
        return a
    return gcd(b, a % b)
N = int(input())
current_lcm = None
for _ in range(N):
    t = int(input())
    if current_lcm is None:
        current_lcm = t
        continue
    current_lcm = current_lcm * t // gcd(current_lcm, t)
print(current_lcm)

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

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

Solution (Python):
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)

N = int(input())
ans = 1

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

print(ans)

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

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

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

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


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


def lcm_list(L):
    return reduce(lcm, L)


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

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

lcm = lambda x, y : x*y // gcd(x, y)
N, *T = map(int, sys.stdin.read().split())
ans = reduce(lcm, T)
print(ans)

Solution (Python):
from fractions import gcd

n = int(input())


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


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

print(ans)

Solution (Python):
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)

N = int(input())
ans = 1

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

print(ans)

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

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

from fractions import gcd

n = int(readline())
t = [int(readline()) for _ in range(n)]
ans = t[0]
for tt in t:
    ans = ans * tt // gcd(ans, tt)
print(ans)

Solution (Python):
from functools import reduce
from fractions import gcd
N = int(input())
tn = [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(tn))

Solution (Python):
def euclid(m, n):
    m0 = m = abs(m)
    n0 = n = abs(n)
    while n != 0:
        m, n = n, m % n
    qm = m0 // m
    lcm = qm * n0
    return lcm


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

Solution (Python):
def euclid(m, n):
    m0 = m = abs(m)
    n0 = n = abs(n)
    while n != 0:
        m, n = n, m % n
    qm = m0 // m
    lcm = qm * n0
    return lcm


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

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

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

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

Solution (Python):
from fractions import gcd


n=int(input())
lcm=int(input())
for i in range(n-1):
    ti=int(input())
    lcm= lcm//gcd(lcm, ti) * ti
print(lcm)

Solution (Python):
import fractions

n = int(input())
t = [0] * n
for i in range(n):
    t[i] = 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 functools
import fractions
def slove(n, t):
    t.sort()
    ans = functools.reduce(lambda x,y:(x*y)//fractions.gcd(x,y), t)
    return ans

if __name__ == "__main__":
    input = sys.stdin.readline
    n = int(input())
    t = [int(input()) for i in range(n)]
    print(slove(n, t))

Solution (Python):
def resolve():
    def lcms(*numbers):
        from fractions import gcd
        from functools import reduce
        def lcm_base(x, y):
            return (x * y) // gcd(x, y)
        return reduce(lcm_base, numbers)
    
    N = int(input())
    T = [int(input()) for i in range(N)]
    print(lcms(*T))




if '__main__' == __name__:
    resolve()

Solution (Python):
import fractions
from functools import reduce

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

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

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

print(lcm_list(T))

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

import sys
sys.setrecursionlimit(2000000)





n = int(input())

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


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 fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)

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

Solution (Python):
def ABC162C(a,b):
    p=a*b
    while b != 0:
        a %= b
        if a == 0:break
        b %= a
    return p//max(a,b)

n=int(input())
a=list()
for i in range(n):
    a.append(int(input()))
p=a[-1]
for i in a[:-1]:
    p=ABC162C(p,i)
print(p)

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
T = [INT() for i in range(N)]

def many_lcm(l):
    tmp = l[0]
    for i in range(1, len(l)):
        tmp = tmp * l[i]//gcd(tmp, l[i])
    return tmp

m = many_lcm(T)
print(m)

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

Solution (Python):
N = int(input())
T = [int(input()) for k in range(N)]
def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)



def lcm(a,b):
    return a*b//gcd(a,b)
ans = 1
for e in T:
    ans = lcm(e,ans)
print(ans)

Solution (Python):
def resolve():
    nclo=range(int(input()))
    from fractions import gcd
    def lcm(a,b):
        return (a*b)//gcd(a,b)
    next=0
    temp=1
    for i in nclo:
        next=int(input())
        temp=lcm(temp,next)
    print(temp)
        

resolve()

Solution (Python):
n = int(input())
T = [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_list(numbers):
  return reduce(lcm_base, numbers, 1)

print(lcm_list(T))

Solution (Python):
from fractions import gcd

N = int(input())

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

print (ans)

Solution (Python):

from fractions import gcd

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

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

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

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

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

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


if __name__ == '__main__':
    main()

Solution (Python):
import math
from functools import reduce
N = int(input())
T = []

for _ in range(N):
    T.append(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)

cur = 1

for t in T:
    cur = lcm(t, cur)

print(cur)

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


from fractions import gcd
n = int(input())
ans = 1
for i in range(n):
    a = int(input())
    ans = a * ans // gcd(a, ans)
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)
ans=1
for _ in range(N):
    t=int(input())
    ans=lcm(ans,t)
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)]
a = T[0]
for i in range(1,N):
    b = T[i]
    c = gcd(a,b)
    a = a*(b//c)
print(a)

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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    from fractions import gcd
    N=I()
    ans=1
    for i in range(N):
        T=I()
        ans=(ans*T)//(gcd(ans,T))
        
        
    print(ans)

main()

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

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

def mylcm(a, b):
    return (a * b) // mygcd(a, b)

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

print(ans)

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


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

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

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(readline())
ans = 1
for _ in range(N):
    ans = lcm(ans, int(readline()))
print(ans)

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

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

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)

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

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

print(lcm_list(T))

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

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)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
n=int(input())
print(lcm_list([int(input()) for i in range(n)]))

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


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


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


if __name__ == '__main__':
    main()

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

Solution (Python):

import sys
from fractions import gcd
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    N=int(input())
    T=[int(input()) for i in range(N)]
    lcm=1
    for x in T:
        lcm*=x//gcd(lcm,x)
    print(lcm)

if __name__ == '__main__':
    main()

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

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

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

print(ans)

Solution (Python):
import fractions
import sys


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

def main():
    N = int(input())
    for i in range(N):
        if i == 0:
            tmp = int(input())
        else:
            a = int(input())
            b = lcm_base(a, tmp)
            tmp = b
    if N == 1:
        print(tmp)
    else:
        print(b)


if __name__ == "__main__":
    main()

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

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