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: Runtime Error

Solution code:
import math
n=int(input())
ar=list(map(int,input().split()))

an=ar[0]
for x in range(1,len(ar)):
	an=(an*ar[x])/math.gcd(an,ar[x]);
print(an)

Submission status: Runtime Error

Solution code:
import fractions

n=int(input())
t=list(int(input()) for i in range(n))

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

Submission status: Runtime Error

Solution code:
n=int(input())
T=[int(input()) for _ in range(n)]
T.sort(reverse=True)

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

ans=int(T[0]/gcd(T[0], T[1]))*T[1]
for i in range(2, n):
    ans=int(T[i]/gcd(ans,T[i]))*ans

print(ans)

Submission status: Runtime Error

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

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

ans=1
for t in T:
    g=gcd(ans, t)
    ans=int(ans*t/g)

print(ans)

Submission status: Runtime Error

Solution code:
import fractions

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

ans = a[0] * a[1] // fractions.gcd(a[0],a[1])

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

Submission status: Runtime Error

Solution code:
import fractions
def lcm(a, b):
    y = a*b / fractions.gcd(a, b)
    return int(y)
N=int(input())
T = [int(input()) for i in range(N)]
if N==1:
    t=T[0]
else:
    t=lcm(T[0],T[1])
    if N>2:
        for i in range(1,N):
            t=lcm(t,T[i])
print(t)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

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


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


def lcm_arr(arr):
    ans = arr[0]
    for i in range(1, n):
        ans = lcm(ans, arr[i])
    return ans


n = int(input())
ans = lcm_arr([int(input()) for _ in range(n)])
print(min(ans, 10 ** 18))

Submission status: Runtime Error

Solution code:

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


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


def lcm_arr(arr):
    ans = arr[0]
    for i in range(1, n):
        ans = lcm(ans, arr[i])
    return ans


n = int(input())
ans = lcm_arr([int(input()) for _ in range(n)])
print(min(ans, 10 ** 18))

Submission status: Runtime Error

Solution code:

def euclid(a, b):
    r = a % b
    if 0 == r:
        return b
    return max(1, euclid(b, r))


def greatest_common_divisor(a, b):
    return int(a * b / euclid(a, b))


def greatest_common_divisor_arr(arr):
    if 1 == n:
        return arr[0]
    else:
        d = greatest_common_divisor(arr[0], arr[1])
        for i in range(2, n):
            d = greatest_common_divisor(d, arr[i])
        return d


n = int(input())
ans = greatest_common_divisor_arr([int(input()) for _ in range(n)])
print(min(ans, 10 ** 18))

Submission status: Runtime Error

Solution code:

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


def greatest_common_divisor(a, b):
    return int(a * b / euclid(a, b))


def greatest_common_divisor_arr(arr):
    if 1 == n:
        return arr[0]
    else:
        d = greatest_common_divisor(arr[0], arr[1])
        for i in range(2, n):
            d = greatest_common_divisor(d, arr[i])
        return d


n = int(input())
ans = greatest_common_divisor_arr([int(input()) for _ in range(n)])
print(min(ans, 10 ** 18))

Submission status: Runtime Error

Solution code:

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


def greatest_common_divisor(a, b):
    return int(a * b / euclid(a, b))


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

if 1 == n:
    print(t[0])
elif 2 == n:
    print(greatest_common_divisor(t[0], t[1]))
else:
    d = greatest_common_divisor(t[0], t[1])
    for i in range(2, n):
        d = greatest_common_divisor(d, t[i])
    print(d)

Submission status: Runtime Error

Solution code:

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


def greatest_common_divisor(a, b):
    return int(a * b / euclid(a, b))


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

if 1 == n:
    print(t[0])
elif 2 == n:
    print(greatest_common_divisor(t[0], t[1]))
else:
    d = greatest_common_divisor(t[0], t[1])
    for i in range(2, len(t)):
        d = greatest_common_divisor(d, t[i])
    print(d)

Submission status: Runtime Error

Solution code:

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


def greatest_common_divisor(a, b):
    return int(a * b / euclid(a, b))


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

if 1 == n:
    print(t[0])
else:
    d = greatest_common_divisor(t[0], t[1])
    for i in range(2, len(t)):
        d = greatest_common_divisor(d, t[i])
    print(d)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**7)
N = int(input())
ts = [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 int(a * b / g)

l = 1
for t in ts:
    l = lcm(l,t)
    
print(l)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**7)
N = int(input())
ts = [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

l = 1
for t in ts:
    l = lcm(l,t)
    
print(l)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**7)
N = int(input())
ts = [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 int(a/g*b)

l = 1
for t in ts:
    l = lcm(l,t)
    
print(l)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**7)
N = int(input())
ts = [int(input()) for _ in range(N)]

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

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

l = 1
for t in ts:
    l = lcm(l,t)
    
print(l)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**7)
N = int(input())
ts = [int(input()) for _ in range(N)]

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

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

l = 1
for t in ts:
    l = lcm(l,t)
    
print(l)

Submission status: Runtime Error

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

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

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

l = 1
for t in ts:
    l = lcm(l,t)
    
print(l)

Submission status: Runtime Error

Solution code:
import math
n = int(input())
T = [int(input()) for _ in range(n)]

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

T.sort()
ans = T.pop(0)
for t in T:
    ans = lcm(ans,t)
print(ans)

Submission status: Runtime Error

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

import math

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

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

if __name__ == '__main__':
    N = int(input())
    T = []
    for i in range(N):
        T.append(int(input()))
    main(N,T)

Submission status: Runtime Error

Solution code:
import sys

sys.setrecursionlimit = 100000

def get_gcd(A, B):
    r = A%B
    if r == 0:
        return B
    else:
        return get_gcd(B, r)
           
if __name__ == '__main__':
    N = int(input())
    T = [int(input()) for _ in range(N)]
    
    for n in range(N-1):
        gcd = get_gcd(T[n], T[n+1])
        T[n+1] = int(T[n]/gcd)*T[n+1]
        
    print(T[N-1])

Submission status: Runtime Error

Solution code:
def get_gcd(A, B):
    r = A%B
    if r == 0:
        return B
    else:
        return get_gcd(B, r)

           
if __name__ == '__main__':
    N = int(input())
    T = [int(input()) for _ in range(N)]
    
    for n in range(N-1):
        gcd = get_gcd(T[n], T[n+1])
        T[n+1] = int(T[n]/gcd)*T[n+1]
        
    print(T[N-1])

Submission status: Runtime Error

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

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

    a = T[0]
    for i in range(1,N):
        A = math.gcd(a, T[i])
        a = a * T[i] // A

    print(a)

Submission status: Runtime Error

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

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

    a = T[0]
    for i in range(1,len(T)):
        A = int(math.gcd(int(a), int(T[i])))
        a = a * T[i] / A

    print(int(a))

Submission status: Runtime Error

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

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

    a = T[0]
    for i in range(1,len(T)):
        A = math.gcd(int(a), int(T[i]))
        a = a * T[i] / A

    print(int(a))

Submission status: Runtime Error

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

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

    a = T[0]
    for i in range(1,len(T)-1):
        A = math.gcd(int(a), int(T[i]))
        a = a * T[i] / A

    print(int(a))

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import math
from functools import reduce


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


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


if __name__ == '__main__':
    n = int(input())
    t = [int(input()) for i in range(n)]

    print(lcm_list(t))

Submission status: Runtime Error

Solution code:
from math import gcd

n = int(input())
tn = [int(input()) for _ in range(n)]
answer = tn[0]
for i in range(1,n):
    answer = answer * tn[i] // gcd(answer,tn[i])
print(answer)

Submission status: Runtime Error

Solution code:
def GCD(a:int , b: int) -> int:
    return a if b == 0 else GCD(b, a % b)
def LCM(a: int, b: int) -> int:
    return a // GCD(a, b) * b 

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

ans = LCM(t[0], t[1])
for i in range(2, n):
    ans = LCM(ans, t[i])

print(ans)

Submission status: Runtime Error

Solution code:
def GCD(a:int , b: int) -> int:
    return a if b == 0 else GCD(b, a % b)
def LCM(a: int, b: int) -> int:
    return a * b // GCD(a, b)

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

ans = LCM(t[0], t[1])
for i in range(2, n):
    ans = LCM(ans, t[i])

print(ans)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

# N < 100
# gcd(a,b) lcd(a,b) = ab

from math import gcd
def lcd(a, b):
    return a*b//gcd(a,b)

l = 1
g = 0
for t in T:
    l = lcd(l, t)
    g = gcd(g, t)
print(l)

Submission status: Runtime Error

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

for i in range(N-1):
   T[i+1] = (T[i] * T[i+1]) // math.gcd(T[i], T[i+1])
print(T[-1])

Submission status: Runtime Error

Solution code:
import math

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

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

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

print(ans)

Submission status: Runtime Error

Solution code:
def l(a, b):
  if a > b:
    a, b = b, a
  return l(a, b % a) if b % a else a

def g(a, b):
  return a * b // l(a, b)

N = int(input())
res = 1
for n in range(N):
  res = g(res, int(input())

print(res)

Submission status: Runtime Error

Solution code:
import math
n=int(input())
t=[int(input()) for _ in [0]*n]

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

Submission status: Runtime Error

Solution code:
import math
n=int(input())
t=[int(input()) for _ in [0]*n]

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

Submission status: Runtime Error

Solution code:
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush
from fractions import gcd
from copy import deepcopy
import math
Mod = 1000000007



def main(): #startline-------------------------------------------
    N = int(input())
    T = [int(input()) for i in range(N)]
    def LCM(i,j):
        return i*j//gcd(i,j)
    tempans = [T[0]]*(N-1)
    for i in range(N-1):
        tempans[i] = LCM(tempans[i],T[i+1])
    print(tempans[N-2])
if __name__ == "__main__":
    main() #endline===============================================




def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n < 2 is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))):
        if prime[i] == 1:
            for j in range(2*i,n):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n):
        if prime[i] == 1:
            res.append(i)
    return res

class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[py] = px
        else:
            self.parent[px] = py

    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
#ABC070C
import math

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

n = int(input())
#tmp = input().split()
#hoge = list(map(lambda a: int(a), tmp))

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

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

print(ans)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
#ABC070C
import math

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

n = int(input())
#tmp = input().split()
#hoge = list(map(lambda a: int(a), tmp))

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

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

print(ans)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
#ABC070C
import math

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

n = int(input())
#tmp = input().split()
#hoge = list(map(lambda a: int(a), tmp))

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

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

print(ans)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
#ABC070C
import math

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

n = int(input())
#tmp = input().split()
#hoge = list(map(lambda a: int(a), tmp))

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

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

print(ans)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
#ABC070C
import math

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

n = int(input())
#tmp = input().split()
#hoge = list(map(lambda a: int(a), tmp))

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

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

print(ans)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
#ABC070C
import math

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

n = int(input())
#tmp = input().split()
#hoge = list(map(lambda a: int(a), tmp))

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

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

print(ans)

Submission status: Runtime Error

Solution code:
import math
import fractions
 
 
def main():
    N = int(input())
    ans = int(input())
    for i in range(N-1):
        T = int(input())
        ans = (ans * T) / fractions.gcd(ans, T)  # 最小公倍数
        ans = int(ans)
    print(ans)
 
 
if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
import math
import fractions


def main():
    N = int(input())
    ans = int(input())
    for i in range(N-1):
        T = int(input())
        ans = (ans * T) / fractions.gcd(ans, T)  # 最小公倍数
        ans = int(ans)
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
import math
from fractions import gcd
from functools import reduce

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


def gcd(numbers):  # "numbers" is list
    return reduce(gcd, numbers, 1)


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


def lcm(numbers):  # "numbers" is list
    return reduce(lcm_base, numbers,
                  1)  # [third argument] return 1 if "numbers" is empty


print(lcm(T))

Submission status: Runtime Error

Solution code:
import math
from functools import reduce

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


def gcd(numbers):  # "numbers" is list
    return reduce(math.gcd, numbers,1)


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


def lcm(numbers):  # "numbers" is list
    return reduce(lcm_base, numbers,
                  1)  # [third argument] return 1 if "numbers" is empty


print(lcm(T))

Submission status: Runtime Error

Solution code:
import math
from functools import reduce

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


def gcd(numbers):  # "numbers" is list
    return reduce(math.gcd, numbers)


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


def lcm(numbers):  # "numbers" is list
    return reduce(lcm_base, numbers,
                  1)  # [third argument] return 1 if "numbers" is empty


print(lcm(T))

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def a(j,k):
    if j>=k:
        while k!=0:
            j,k= k,j%k
        return j
    else:
        while j!=0:
            k,j =j, k%j
        return k;

      
def b(s , r):
    h = a(s,r)
    return s*r/h
  
  
n = int(input())

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

k = a(t[0] , t[1])

for u in range(n):
    i = k
    k = b(t[u],i)

print(int(k))

Submission status: Runtime Error

Solution code:
import fractions


def main():
    N = int(input())
    ans = int(input())
    for i in range(N-1):
       T = int(input())
       ans = (ans * T) / fractions.gcd(ans, T)
       ans = int(ans)


    print(ans)


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(100000)

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

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

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

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

print(ans)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(100000)

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

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

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

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

print(ans)

Submission status: Runtime Error

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

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

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

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

print(ans)

Submission status: Runtime Error

Solution code:
# ABC 70, C - multiple clock
import math

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] // math.gcd(ans, T[i])

print(ans)

Submission status: Runtime Error

Solution code:
import math

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

n = int(input())

t = int(input())
for i in range(n-1):
    p = int(input())
    if(p%t == 0 and p>=t):
        t = p
    else:
        lcm(t,p) 
        
print(t)

Submission status: Runtime Error

Solution code:
import math

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

n = int(input())

t = int(input())
for i in range(n-1):
    p = int(input())
    t = lcm(t,p) if(p!=t) else t

print(t)

Submission status: Runtime Error

Solution code:
import math

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

n = int(input())

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

print(t)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# ABC070-C
import math
from functools import reduce
N = int(input())
T = []
for i in range(N):
    T.append(int(input()))

def lcm_base(x, y):
    return (x * y ) // math.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers)
print(lcm_list(T))

Submission status: Runtime Error

Solution code:
from decimal import Decimal
import fractions


N = int(input())

now = Decimal("1")

for i in range(N):

    T = Decimal(input())

    now = now * T / fractions.gcd(now,T)

print("{:.0f}".format(now))

Submission status: Runtime Error

Solution code:
from decimal import Decimal
import fractions


N = int(input())

now = Decimal("1")

for i in range(N):

    T = Decimal(input())

    now = now * T / fractions.gcd(now,T)

now = int(now)

print("{:.100g}".format(now))

Submission status: Runtime Error

Solution code:
import fractions


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


N = int(input())
clock = [0] * N
for j in range(N):
    clock[j] = int(input())
gcd = clock[0]

ans = clock[0]
for i in range(1, N):
    gcd = GCD(ans, clock[i])
    ans = ans/gcd
    ans = ans * clock[i]

print(int(ans))

Submission status: Runtime Error

Solution code:
import fractions


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


N = int(input())
clock = [0]*N
gcd = int(input())
clock[0] += gcd
ans = clock[0]
for i in range(1, N):
    clock[i] = int(input())
    gcd = GCD(gcd, clock[i])
   
    ans = ans/gcd
    ans = ans * clock[i]

print(int(ans))

Submission status: Runtime Error

Solution code:
import fractions


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


N = int(input())
clock = [0]*N
gcd = int(input())
clock[0] = gcd
ans = clock[0]
for i in range(1, N):
    clock[i] = int(input())
    gcd = GCD(ans, clock[i])
    ans = ans/gcd
    ans *= clock[i]

print(int(ans))

Submission status: Runtime Error

Solution code:
import fractions


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


N = int(input())
clock = [0]*N
gcd = int(input())
clock[0] = gcd
ans = clock[0]
for i in range(1, N):
    clock[i] = int(input())
    gcd = GCD(ans, clock[i])
    ans /= gcd
    ans *= clock[i]

print(int(ans))

Submission status: Runtime Error

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


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

#a, b, c, d = (int(i) for i in input().split())  
#W = [int(i) for i in input().split()] 
#import math

#N, K = (int(i) for i in input().split())
#S = input()
S_list = []
t_list = []
N = int(input())
for i in range(N):
    t = int(input())
    t_list.append(t)
    pass

mul = 1

for t in t_list:
    mul = lcm(mul, t)
print(mul)

Submission status: Runtime Error

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

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

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

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

Submission status: Runtime Error

Solution code:
import math

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

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

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

Submission status: Runtime Error

Solution code:
n = int(input())
def gcd(a, b):
  if not b:
    return a
  else:
    return gcd(b, a % b)
def lcm(a, b):
  return a * b / gcd(a, b)
ans = 1
for _ in range(n):
  c = int(input())
  ans = lcm(ans, c)
print(ans)

Submission status: Runtime Error

Solution code:
from fractions import gcd
def lcm(a,b):return int(a*b/gcd(a,b))
N,x=int(input()),1
for _ in range(N):x=lcm(x,int(input()))
print(x)

Submission status: Runtime Error

Solution code:
import math
N = int(input())
T = []
for i in range(N):
  T.append(int(input()))
# output LCM(T1,T2... Tn)=LCM(Tn,LCM(Tn-1,LCM(...)))
def lcm(a,b):
  g = math.gcd(a,b)
  #print(g)
  return int(a*b/g)
ans = T[0]
for i in range(1,len(T)):
  ans = lcm(ans,T[i])
print(ans)

Submission status: Runtime Error

Solution code:

from math import gcd      #3.5
def lcm(x, y):
    return (x * y) // gcd(x, y)

nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

N = n()
common = n()
for i in range(N-1):
    common = lcm(common, n())

print(common)

Submission status: Runtime Error

Solution code:
#最大公約数を求める
def gcd(a,b):
    #a>bとなるように入れ替え
    if a < b:
        tmp = a
        a = b
        b = tmp
    
    #ユークリッドの互除法
    r = a % b
    while r != 0:
        a = b
        b = r
        r = a % b
    
    return b

#最小公倍数を求める
def lcm(a,b):
    return int((a*b)/gcd(a,b))

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

#Tのリストの2数のlcmを求めて範囲を広げていく
tmp_lcm = 1 #現在の範囲までのlcm
for i in range(N):
    tmp_lcm = lcm(tmp_lcm,T[i])

print(tmp_lcm)

Submission status: Runtime Error

Solution code:
import math
from functools import reduce
n=int(input())
t=[int(input()) for i in range(n) ]
def lcm_sorce(x,y):
    return (x*y)//math.gcd(x,y)
def lcm_list(list_name):
    return reduce(lcm_sorce,list_name)
print(lcm_list(t))

Submission status: Runtime Error

Solution code:
n=int(input())
t=[int(input()) for i in range(n) ]
import math
from functools import reduce
def lcm_sorce(x,y):
    return (x*y)//math.gcd(x,y)
def lcm_list(list_name):
    return reduce(lcm_sorce,list_name)
print(lcm_list(t))

Submission status: Runtime Error

Solution code:
# 2019/06/22
# AtCoder Beginner Contest 070 - C

import fractions

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

# Input
n = int(input())
alcm = 1

for i in range(n):
    wt = int(input())
    alcm = lcm_fgf(alcm, wt)

# Output
print(alcm)

Submission status: Runtime Error

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


def LCM(a, b):
    return a * b // GCD(a, b)

n = int(input())
a = int(input())
for i in range(n-1):
    ans = LCM(a, int(input()))

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())

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

answer = 0
for _ in range(N):
  answer = gcd(answer, int(input())
               
print(answer)

Submission status: Runtime Error

Solution code:
import fractions as frac
n=int(input())
t=[int(input()) for _ in range(n)]
x=t[0]
ans=t[0]
for i in range(1,n):
    g=frac.gcd(x,t[i])
    ans=x*y//g
    x=ans
print(int(ans))

Submission status: Runtime Error

Solution code:
import fractions as frac
n=int(input())
t=[int(input()) for _ in range(n)]
t=sorted(set(t))
t1=t[0]
if n==1:
    print(t1)
    exit()
for i in range(1,len(t)):
    t2=t[i]
    ans=t1*t2/frac.gcd(t1,t2)
    t1=ans
print(int(ans))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import fractions as frac
n=int(input())
t1=int(input())
for i in range(n-1):
    t2=int(input())
    ans=t1*t2/frac.gcd(t1,t2)
    t1=ans
print(int(ans))

Submission status: Runtime Error

Solution code:
import fractions as frac
n=int(input())
t1=int(input())
for i in range(n-1):
    t2=int(input())
    ans=t1*t2/frac.gcd(t1,t2)
    t1=t2
print(int(ans))

Submission status: Runtime Error

Solution code:
from fractions import gcd as g
def l(a,b):
  x=a*b/g(a,b)
  return int(x)
n=int(input())
if n==1:
  print(int(input()))
else:
  for _ in range(n):
    t=int(input())
    m=l(t,m)
  print(m)

Submission status: Runtime Error

Solution code:
from fractions import gcd as g
def l(a,b):
  x=a*b/g(a,b)
  return int(x)
n=int(input())
t=[0]*n
for _ in range(n):
  t[_]=int(input())
if n==1:
  print(t[0])
else:
  m=l(t[0],t[1])
  for i in range(1,n):
    m=l(t[i],m)
  print(m)

Submission status: Runtime Error

Solution code:
from fractions import gcd as g
def l(a,b):
  x=a*b/g(a,b)
  return int(x)
n=int(input())
t=[0]*n
for _ in range(n):
  t[_]=int(input())
m=l(t[0],t[1])
for i in range(1,n):
  m=l(t[i],m)
print(m)

Submission status: Runtime Error

Solution code:
import fractions as frac
n = int(input())
t = []
for i in range(n):
  t.append(int(input()))
tmp = t[0]
for i in range(1,n):
  if tmp % t[i] != 0:
    tmp = int(tmp * t[i] /frac.gcd(tmp,t[i]))
print(tmp)

Submission status: Runtime Error

Solution code:
import fraction

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

for i in range(N):
    lcd = int(lcd*T[i] / fraction.gcd(lcd,T[i]))
    
print(lcd)