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



Sample input:
2
2
3


Sample output:
6

Submission status: Accepted

Solution code:
from fractions import gcd
n = int(input())
ans = 1
for i in range(n):
    t = int(input())
    if ans%t!=0:
        ans = ans*t//gcd(ans,t)
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
s = [int(input()) for i in range(N)]

import fractions

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

Submission status: Accepted

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

from fractions import gcd


def lcm(t):
  x = t[0]
  for i in range(1, len(t)):
    x = (x * t[i]) // gcd(x, t[i])
  return x  

print(lcm(t))

Submission status: Accepted

Solution code:
from fractions import gcd
from functools import reduce
n=int(input())
t=[]
for _ in range(n):
    t.append(int(input()))
def lcm(a,b):
    return a*b//gcd(a,b)
lc=reduce(lcm,t)
print(lc)

Submission status: Accepted

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

def gcd(n, m):
    if m > n:
        n, m = m, n
    if m == 0:
        return n
    r = 0
    while n % m != 0:
        r = n % m
        n = m
        m = r
    return m

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

def lcm_vec(v):
    r = v[0]
    for i in v[1:]:
        r = lcm(r, i)
    return r

print(lcm_vec(a))

Submission status: Accepted

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

    #S=[15,25,30]

    print(reduce(lcm,S))




resolve()

Submission status: Accepted

Solution code:

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

# 最大公約数(greatest_common_divisor)
def gcd(a, b):
  if b == 0:
    return a
  return gcd(b, a%b)

# 最小公倍数(lowest_common_multiple)
def lcm(a, b):
  return a*b//gcd(a,b)

# 最小公倍数と、比べていない数字を比べ、最小公倍数を更新する
alcm = t[0]
for i in t[1:]:
  alcm = lcm(alcm, i)

print(alcm)

Submission status: Accepted

Solution code:
def gcd(a,b):
    while b:a,b=b,a%b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)
def main():
    N = int(input())
    T = [int(input())for _ in range(N)]
    tmp = T[0]
    for i in range(1,N):
        tmp = lcm(tmp,T[i])
    print(tmp)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from fractions import gcd

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from fractions import gcd

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

def lcm_list(a):
    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_list(T))

Submission status: Accepted

Solution code:
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-1):
    t=int(input())
    T=lcm(t,T)
print(T)

Submission status: Accepted

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

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


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

Submission status: Accepted

Solution code:
N = int(input())
from fractions import gcd

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

print(ans)

#print(*ans, sep='\n')

Submission status: Accepted

Solution code:
def fcd(a , b):
    
    if a>= b:
        while b != 0:
            a,b = b,a%b
        return a
    
    else:
        while a != 0:
            b,a = a,b%a
        return b
    
    
def lcm(a,b):
    return a*b//fcd(a , b)


n = int(input())
t_list = []
ans_list = []
for i in range(n):
    t_list.append(int(input()))
    
    
for i in range(len(t_list)):
    if i == 0:
        ans_list.append(t_list[0])
        continue
    if i == 1:
        ans_list.append(lcm(t_list[0] , t_list[1]))
    
    if i >=2:
        ans_list.append(lcm(ans_list[-1],t_list[i]))
print(ans_list[-1])

Submission status: Accepted

Solution code:
n = int(input())
x = 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)


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

Submission status: Accepted

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

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)

Submission status: Accepted

Solution code:
import fractions
from functools import reduce

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

Submission status: Accepted

Solution code:
import fractions
from functools import reduce

N = int(input())
T = list(int(input()) for _ in range(N))


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

Submission status: Accepted

Solution code:
from collections import defaultdict

N = int(input())
Ts = list(set([int(input()) for _ in range(N)]))

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

res = Ts[0]
for T in Ts:
    res = lcm(res, T)
print(int(res))

Submission status: Accepted

Solution code:
def main():
    from builtins import int, map, list, print
    from fractions import gcd
    from functools import reduce
    import sys
    def lcm(x, y):
        return (x * y) // gcd(x, y)

    sys.setrecursionlimit(10 ** 6)

    input = sys.stdin.readline
    input_number = (lambda: int(input()))

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

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
_,a,*l=map(int,open(0))
from fractions import*
for i in l:a*=i//gcd(a,i)
print(a)

Submission status: Accepted

Solution code:
_,a,*l=map(int,open(0))
for i in l:
  x,y=a,i
  while y: x,y=y,x%y
  a*=i//x
print(a)

Submission status: Accepted

Solution code:
_,a,*l=map(int,open(0).read().split())
for i in l:
  x,y=a,i
  while y: x,y=y,x%y
  a*=i//x
print(a)

Submission status: Accepted

Solution code:
import fractions
N=int(input())
T=[int(input()) for _ in range(N)]
num=T[0]
for i in range(N-1):
 num=int((num *T[i+1])//(fractions.gcd(num,T[i+1])))
print(num)

Submission status: Accepted

Solution code:
from fractions import gcd
n=int(input())
g=int(input())
for _ in range(n-1):
  a=int(input())
  g=(a*g)//gcd(a,g)
print(g)

Submission status: Accepted

Solution code:
n = int(input())
l = [int(input()) for _ in range(n)]
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

print(lcm(l))

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
from functools import reduce
from fractions import gcd


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


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

Submission status: Accepted

Solution code:
import fractions
from functools import reduce

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

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

Submission status: Accepted

Solution code:
from fractions import gcd


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


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


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
n = int(input())
l = [int(input()) for _ in range(n)]

from fractions import gcd
def lcms(List):
    __ = 1
    for _ in List:
        __ =int(__ * _ // gcd(__, _))
    return __

print(lcms(l))

Submission status: Accepted

Solution code:
import fractions

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

ans = t[0]

for tn in t:
    ans = ans * tn // fractions.gcd(ans, tn)

print(ans)

Submission status: Accepted

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

#入力tについて、最小公倍数を求めればそれが答えとなる
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)

Submission status: Accepted

Solution code:
import fractions

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

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


print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(200000000)

N = int(input())
NUMS = [int(input()) for _ in range(N)]
NUMS = list(set(NUMS))

def gcd(num1, num2):
    if num2 == 0:
        return num1
    else:
        return gcd(num2, num1 % num2)


res = NUMS[0]
for num in NUMS[1:]:
    res = res * num // gcd(res, num)

print(int(res))

Submission status: Accepted

Solution code:
import sys
import fractions
sys.setrecursionlimit(200000000)

N = int(input())
NUMS = [int(input()) for _ in range(N)]
NUMS = list(set(NUMS))

def gcd(num1, num2):
    if num2 == 0:
        return num1
    else:
        return gcd(num2, num1 % num2)


res = NUMS[0]
for num in NUMS[1:]:
    res = res * num // gcd(res, num)

print(int(res))

Submission status: Accepted

Solution code:
import sys
import fractions
sys.setrecursionlimit(200000000)

N = int(input())
NUMS = [int(input()) for _ in range(N)]
NUMS = list(set(NUMS))

def gcd(num1, num2):
    if num2 == 0:
        return num1
    else:
        return gcd(num2, num1 % num2)


res = NUMS[0]
for num in NUMS[1:]:
    res = res * num // fractions.gcd(res, num)

print(int(res))

Submission status: Accepted

Solution code:
#coding: utf-8
import math
import heapq
import bisect
import numpy as np
from collections import Counter
import fractions
#from scipy.misc import comb

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

T.sort()

print(reduce(lcm, T))

Submission status: Accepted

Solution code:
from fractions import gcd

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from functools import reduce
import sys
try:
    from typing import List
except ImportError:
    pass


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


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


def solve(N: int, T: "List[int]"):
    print(reduce(lcm, T))


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    T = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, T)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from fractions import gcd
def lcm(list):
    if len(list) == 1:
        return list[0]
    if len(list) == 2:
        [a, b] = list
        return a*b//gcd(a,b)
    x = list.pop()
    y = lcm(list)
    return x*y//gcd(x,y)

N = int(input())
li = []
for i in range(N):
    li.append(int(input()))
print(lcm(li))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
Ts = [int(input()) for i in range(N)]

def saishokoubaisuu(n,m):
    a = max(n,m)
    b = min(n,m)
    while b:
        a, b = b, a % b
    return n*m//a

ans = 1
for t in Ts:
    ans = saishokoubaisuu(ans,t)
print(ans)

Submission status: Accepted

Solution code:

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

def lcd(n, m):
    # 最小公倍数
    a = max(n,m)
    b = min(n,m)
    while b:
        a, b = b, a % b
    return n*m//a

ans = 1
for t in ts:
    ans = lcd(ans,t)
print(ans)

Submission status: Accepted

Solution code:
def gcd(n, m):
    # 最大公約数
    a = max(n,m)
    b = min(n,m)
    while b:
        a, b = b, a % b
    return a
lcd = 1

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

for t in ts:
    lcd = (lcd*t)//gcd(lcd,t)

print(lcd)

Submission status: Accepted

Solution code:
import fractions
n = int(input())
#a = list(map(int, input().split()))
a = []
for i 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)

Submission status: Accepted

Solution code:
n = int(input())
t = [int(input()) for _ in range(n)]
ans = 1

from fractions import gcd

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

for v in t:
    ans = lcm(ans, v)

print(ans)

Submission status: Accepted

Solution code:
from fractions import gcd

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

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

Submission status: Accepted

Solution code:
import fractions
from functools import reduce

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

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

def lcm(num):
    return reduce(lcm_b, num, 1)

print(lcm(t))

Submission status: Accepted

Solution code:
import fractions
N=int(input())
res=1
for i in range(N):
    T=int(input())
    res=res*T//fractions.gcd(res,T)
print(res)

Submission status: Accepted

Solution code:
def gcb(a,b):
    if a>b:
        x,y=a,b
    else:
        x,y=b,a
    while True:
        if x%y!=0:
            x,y=y,x%y
        else:
            return y
def lcb(a,b):
    return a*b//gcb(a,b)
N=int(input())
T=[int(input()) for _ in range(N)]
ans=1
for i in range(N):
    ans=lcb(ans,T[i])
print(ans)

Submission status: Accepted

Solution code:
import fractions
N,T1=int(input()),int(input())
for n in range(1,N):
    T2=int(input())
    T1=(T1*T2)//fractions.gcd(T1,T2)
print(T1)

Submission status: Accepted

Solution code:
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 = 1
for x in t:
    ans = ans * x // gcd(ans, x)
print(ans)

Submission status: Accepted

Solution code:
import fractions
from functools import reduce
N = int(input())
T = [int(input()) for _ in range(N)]

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

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

print(lcm_list(T))

Submission status: Accepted

Solution code:
from fractions import gcd
from functools import reduce


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


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


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


print(lcm(T))

Submission status: Accepted

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

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

print(lcm_list(numbers))

Submission status: Accepted

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

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


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

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

print(answer)

Submission status: Accepted

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

import fractions
N=int(input())
t=[int(input()) for _ in range(N)]
ans = 1
for item in t:
  ans = lcm(ans, item)
print(int(ans))

Submission status: Accepted

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

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

    print(lcm_list(num_list))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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] // gcd(ans , t[i])
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from fractions import gcd

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

if N==1:
  print(T[0])
else:
  S[0]=T[0]
  for j in range(1,N):
    a=S[j-1]*T[j]
    S[j]=a//gcd(S[j-1],T[j])
  print(S[-1])

Submission status: Accepted

Solution code:
import fractions
N=int(input())
list=[]
for a in range(N):
    T=int(input())
    list.append(T)
ans=list[0]
for z in range(1,N):
    ans=ans*list[z]//fractions.gcd(ans,list[z])
print(ans)

Submission status: Accepted

Solution code:
from functools import reduce
from fractions import gcd
def lcm(a,b):
    return a * b // gcd(a,b)
n = int(input())
print(reduce(lcm, [int(input()) for i in range(n)]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

N = int(input().strip())
T_list = [int(input().strip()) for _ 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 = T_list[0]
for i in T_list[1:]:
    ans = lcm(ans, i)

print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

N = int(input().strip())
T_list = [int(input().strip()) for _ in range(N)]
#-----

def gcd(a,b):
    x = max(a,b)
    y = min(a,b)

    while y != 0:
        r = x % y
        
        x = y
        y = r
    
    return x

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


ans = T_list[0]
for i in T_list[1:]:
    ans = lcm(ans, i)

print(ans)

Submission status: Accepted

Solution code:
def main():
  n = int(input())
  t = []
  for _ in range(n):
    t.append(int(input()))
  print(lcm_list(t))
  
def input_list():
  return map(int, input().split())

def input_list_str():
  return map(str, input().split())

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

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

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

# 2で割り切れる回数
def divide_two(arg):
  c = 0
  while True:
    if c >= 2:
      break
    if arg % 2 != 0:
      break
    arg //= 2
    c += 1
  return c 

import math
import fractions
from functools import reduce
main()

Submission status: Accepted

Solution code:
import fractions
N = int(input())
T = []


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


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


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

print(M)

Submission status: Accepted

Solution code:
import fractions

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

def lcm(a,b):  # python 3.5 ~ import math
    return a*b //fractions.gcd(a,b)
lc = t[0]
for i in range(1,n):
    lc = lcm(t[i],lc)
print(lc)

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

from fractions import gcd

def mygcd(a,b):
    gcd_list = []
    for i in range(1,int(min(a,b)**0.5)+1):
        if a%i == 0 and b%i == 0:
            gcd_list.append(i)
    return max(gcd_list)

number = T[0]

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

Submission status: Accepted

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

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

main()

Submission status: Accepted

Solution code:
n=int(input())
t=[]
tt=[]
for _ in range(n):
  T=int(input())
  t.append(T)
for i in range(n):
  if t[i] not in tt:
    tt.append(t[i])
import fractions
ans=tt[0]
for i in range(1,len(tt)):
  ans=ans*tt[i]//fractions.gcd(ans,tt[i])
print(ans)

Submission status: Accepted

Solution code:
#a,bの最大公約数
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

#a,bの最小公倍数
def lcm(a, b):
    return a // gcd (a, b) * b

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

print(ans)

Submission status: Accepted

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


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


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

Submission status: Accepted

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


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


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

Submission status: Accepted

Solution code:
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())
tmp1=int(input())
ans=tmp1
for i in range(n-1):
    tmp2=int(input())
    ans=lcm(tmp1,tmp2)
    tmp1=ans
print(ans)

Submission status: Accepted

Solution code:
#070_C
from functools import reduce
from fractions import gcd
def lcm(x,y):
    return x*y//gcd(x,y)
n=int(input())
t=[int(input()) for _ in range(n)]
print(reduce(lcm,t))

Submission status: Accepted

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

Submission status: Accepted

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

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

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

ans=1

for t in T:
    ans=lcm(max(ans,t),min(ans,t))

print(ans)

Submission status: Accepted

Solution code:
import fractions as math
a = int(input())
c = 1
for i in range(a):
  b = int(input())
  c = b*c//math.gcd(b,c)
print(c)

Submission status: Accepted

Solution code:
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)
def lcms(n):
    return reduce(lcm,n,1)
print(lcms(t))

Submission status: Accepted

Solution code:
import fractions
from functools import reduce

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

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

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

print (lcm_list(l))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fractions

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

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = int(input())

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

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

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

print(T)

Submission status: Accepted

Solution code:
import fractions

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

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

ans = T[0]

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

print(ans)

Submission status: Accepted

Solution code:
import fractions

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

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

ans = t[0]

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

import fractions
if n==1: print(t[0])
else:
    a,b=t[0],t[1]
    res=a*b//fractions.gcd(a,b)
    for i in range(2,n):
        tmp=t[i]
        res = res*tmp//fractions.gcd(res,tmp)
    print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
# coding: utf-8
from fractions import gcd 
from functools import reduce
import sys
sys.setrecursionlimit(200000000)
from inspect import currentframe


# my functions here!
#標準エラー出力
def printargs2err(*args):
    names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' : '+repr(arg) for arg in args),file=sys.stderr)
def debug(x):
    print(x,file=sys.stderr)
def printglobals():
    for (symbol, value) in globals().items():
        print('symbol="%s"、value=%s' % (symbol, value),file=sys.stderr)
def printlocals():
    for (symbol, value) in locals().items():
        print('symbol="%s"、value=%s' % (symbol, value),file=sys.stderr)
#入力（後でいじる）
def pin(type=int):
    return map(type,input().split())

#繰り返し自乗法だよ
#これはnのp乗をmで割ったあまりをだすよ
def modular_w_binary_method (n,m,p):
    ans=1 if n>0 else 0
    while(p>0):
        if p%2==1:
            ans=(ans*n)%m
        n=(n**2)%m
        p//=2
    return ans
#mod上でのaの逆元を出すよ
"""
    フェルマーの小定理より a**(p)%p==a isTrue
    これを利用すれば a**(p-2)%p==a**(-1) isTrue
    元と逆元とをかけてpで割れば1が余るよ！
"""
def modular_inverse(a,prime):
    return(modular_w_binary_method(a,prime,prime-2))
#逆元を使うと容易に頑張れるｃ
def conbination(n,a,mod=10**9+7):
    #cはイラない
    res=1 
    for s in range(a):
        res=(res*(n-s)*(modular_inverse(s+1,mod)))%mod

        
    return res
#操作から作れるものの組み合わせは何個かー＞同じものでも違う方法で構成できるかから考える方法もある
"""
"""

#solution:

#input
N,=pin()
T=[int(input()) for i in range(N)]
from fractions import gcd
def lcm2(x, y):
    return (x * y) // gcd(x, y)
def lcm(numbers):
        return reduce(lcm2,numbers,1)
print(lcm(T))

#print(h)
#print(m)
#print(["No","Yes"][cond])
#print([["NA","YYMM"],["MMYY","AMBIGUOUS"]][cMMYY][cYYMM])
"""
#printデバッグ消した？
#前の問題の結果見てないのに次の問題に行くの？
"""
"""
お前カッコ閉じるの忘れてるだろ
"""