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:
n = int(input())
tt = []
for i in range(n):
    tt.append(int(input()))
    
ss = int(1)

for i in tt:
    p = []
    p.append(int(ss))
    p.append(int(i))
    q = list(sorted(p))
    while q[1] % q[0] != 0:
        r = [q[1] % q[0] , q[0]]
        s = list(sorted(r))
        q[0] = int(s[0])
        q[1] = int(s[1])

        
    ss = int(ss * i / q[0])

print(int(ss))

Submission status: Runtime Error

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

for i in tt:
    p = []
    p.append(ss)
    p.append(i)
    q = list(sorted(p))
    while q[1] % q[0] != 0:
        r = [q[1] % q[0] , q[0]]
        s = list(sorted(r))
        q[0] = s[0]
        q[1] = s[1]

        
    ss = int(ss * i / q[0])

print(int(ss))

Submission status: Runtime Error

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

for i in tt:
    p = []
    p.append(ss)
    p.append(i)
    q = list(sorted(p))
    while q[1] % q[0] != 0:
        r = [q[1] % q[0] , q[0]]
        s = list(sorted(r))
        q[0] = s[0]
        q[1] = s[1]
        print(q)
        
    ss = int(ss * i / q[0])

print(int(ss))

Submission status: Runtime Error

Solution code:
from math import gcd

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

print(Ans)

Submission status: Runtime Error

Solution code:
import math
import functools
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

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

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



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

Submission status: Runtime Error

Solution code:
N = int(input())
listClock = [int(input()) for i in range(N)]
def gcd(x, y):
    while y > 0:
        x, y = y, x%y
    return x

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

ans = 1

for i in listClock:
    ans = int(lcm(ans,i))

print(ans)

Submission status: Runtime Error

Solution code:
import math
from functools import reduce
N = int(input())
listClock = [int(input()) for i in range(N)]
def retLCM_base(a,b):
    return (a * b) // math.gcd(a, b)

def retLCM(*Num):
    return reduce(retLCM_base, Num, 1)

print(retLCM(*listClock))

Submission status: Runtime Error

Solution code:
import fractions
t=1
for i in range(int(input())):
    s=int(input())
    t=t*s//math.gcd(s,t)
print(t)

Submission status: Runtime Error

Solution code:
import math
t=1
for i in range(int(input())):
    s=int(input())
    t=t*s//math.gcd(s,t)
print(t)

Submission status: Runtime Error

Solution code:
import functools
import math

def gcd(x,y):
    a,b = max(x,y), min(x,y)
    while a % b != 0:
        a,b = b,a%b

    return b

def lcm2(x,y):
    return int(x*y / gcd(x,y))
    
N = int(input())
T = []
for i in range(N):
    ti = int(input())
    T.append(ti)

result = 1
for t in T:
    result = lcm2(result, t)

print(result)

Submission status: Runtime Error

Solution code:
import functools
import math

def gcd(x,y):
    a,b = max(x,y), min(x,y)
    while a % b != 0:
        a,b = b,a%b

    return b
    

def lcm2(x,y):
    return int(x*y / gcd(x,y))

def lcm_lot(nums):
    return functools.reduce(lcm2, nums, 1)

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

print(lcm_lot(T))

Submission status: Runtime Error

Solution code:
import functools
import math

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

def lcm_lot(nums):
    return functools.reduce(lcm2, nums, 1)

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

print(lcm_lot(T))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
n = int(input())
prev = 0
for i in range(n):
    if(i == 0):
        prev = int(input())
    else:
        t = int(input())
        prev = int(prev * t / math.gcd(prev, t))
print(prev)

Submission status: Runtime Error

Solution code:
import math
n = int(input())
prev = 0
for i in range(n):
    if(i == 0):
        prev = int(input())
    else:
        t = int(input())
        prev = prev * t // math.gcd(prev, t)
print(prev)

Submission status: Runtime Error

Solution code:
#include <algorithm>
#include <iostream>
#include <set>
#include <vector>
#include <cmath>
#include <utility>
#include <numeric>

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;

#define all(a) (a).begin(), (a).end()
#define rep(i, n) for (int i=0;(i)<(n);(i)++)
#define repi(i, n) for (int i=0;(i)<=(n);(i)++)
#define repr(i, n) for (int i=n;(i)>=0;(i)--)
#define print(x) (cout<<x<<endl)

ll gcd(ll a, ll b) {
    if (b==0) return a;
    return gcd(b, a%b);
}

ll lcm(ll a, ll b) {
    return a/gcd(a,b)*b;
}

int main() {
    int N; cin>>N;
    ll t=1LL;
    rep(i,N) {
        ll T; cin>>T;
        t = lcm(t, T);
    }
    print(t);
}

Submission status: Runtime Error

Solution code:
def koubai(a,b):
    if b==0:
        return a
    return(koubai(b,a%b))
def kouyaku(a,b):
    return a*b/koubai(a,b)

N=int(input())
if N==1:
    print(int(input()))
    exit()
ans=1
for i in range(N):
    ans=kouyaku(ans,int(input()))
print(int(ans))

Submission status: Runtime Error

Solution code:
def koubai(a,b):
    if b==0:
        return a
    return(koubai(b,a%b))
def kouyaku(a,b):
    return a*b/koubai(a,b)

N=int(input())
if N==1:
    print(int(input()))
ans=1
for i in range(N):
    ans=kouyaku(ans,int(input()))
print(int(ans))

Submission status: Runtime Error

Solution code:
def koubai(a,b):
    if b==0:
        return a
    return(koubai(b,a%b))
def kouyaku(a,b):
    return a*b/koubai(a,b)

N=int(input())
ans=1
T=[0]*N
for i in range(N):
    ans=kouyaku(ans,int(input()))
print(int(ans))

Submission status: Runtime Error

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

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

n = int(input())

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

print (time)

Submission status: Runtime Error

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

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

n = int(input())

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

print (time)

Submission status: Runtime Error

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

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

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

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

print (time)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import sys
import collections
import math
# code start
def lcm(a,b):
	return a*b/math.gcd(int(a),int(b))

def main():
	count = int(input())
	i = 0
	temp = 1
	while(i<count):
		i+=1
		num = int(input())
		temp = lcm(temp,num)
	print(int(temp))


main()

# code end

Submission status: Runtime Error

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

import math

# code start
def lcm(a,b):
	return a*b/math.gcd(int(a),int(b))

def main():
	count = int(input())
	i = 0
	temp = 1
	while(i<count):
		i+=1
		num = int(input())
		temp = lcm(temp,num)
	print(int(temp))


if __name__ == '__main__':
    main()

# code end

Submission status: Runtime Error

Solution code:
N = int(input())
lis=[0]*N
for i in range(N):
    lis[i]=(int(input()))
def Euc(x,y):
    if y == 0:
        return x
    else:
        return Euc(y,x%y)
def common_multiple(x,y):
    return int(x*y/Euc(x,y))
out = 1
for i in lis:
    out = common_multiple(out,i)
print(out)

Submission status: Runtime Error

Solution code:
N = int(input())
lis=[0 for i in range(N)]
for i in range(N):
    lis[i]=(int(input()))
if N == 1:
    print(lis[0])
    exit()
def Euc(x,y):
    s=0;b=0;rem=0;
    if x>y:
        s=y;b=x
    elif y>x:
        s=x;b=y
    else:
        return x
    while True:
        rem = b%s
        if rem == 0:
            return int(x*y/s)
        b = s
        s = rem
a = lis[0]
for i in range(N-1):
    a = Euc(a,lis[i+1])
print(a)

Submission status: Runtime Error

Solution code:
from functools import reduce

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

def lcm(a, b):
  return a * b / gcd(a, b)
def main():
  
  n = int(input())
  li = []
  for i in range(n):
    inp = int(input())
    li.append(inp)

  ans = int(reduce((lambda x, y: lcm(x, y)), li))
  if ans > 1e18:
    ans = 1e18
  print(ans)

if __name__ == "__main__":
  main()

Submission status: Runtime Error

Solution code:
from functools import reduce
def gcd(a, b):
  if (b == 0):
    return a;

  return gcd(b, a % b)


def lcm(a, b):
  return a * b / gcd(a, b);
def main():
  
  n = int(input())
  li = []
  for i in range(n):
    inp = int(input())
    li.append(inp)

  ans = int(reduce((lambda x, y: lcm(x, y)), li))
  if ans > 1e18:
    ans = 1e18
  print(ans)

if __name__ == "__main__":
  main()

Submission status: Runtime Error

Solution code:
from functools import reduce
def gcd(a, b):
  if (b == 0):
    return a;

  return gcd(b, a % b)


def lcm(a, b):
  return a * b / gcd(a, b);
def main():
  
  n = int(input())
  li = []
  for i in range(n):
    li.append(int(input()))

  ans = int(reduce((lambda x, y: lcm(x, y)), li))

  print(ans)

if __name__ == "__main__":
  main()

Submission status: Runtime Error

Solution code:
from functools import reduce
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())
li = []
for i in range(n):
  li.append(int(input()))

ans = int(reduce((lambda x, y: lcm(x, y)), li))

print(ans)

Submission status: Runtime Error

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

def Euc(x,y):
    s=0;b=0;rem=0;
    if x>y:
        s=y;b=x
    elif y>x:
        s=x;b=y
    else:
        return int(x)
    while True:
        rem = b%s
        if rem == 0:
            return int(x*y/s)
        b = s
        s = rem
a = lis[0]
for i in range(N-1):
    a = Euc(a,lis[i+1])
print(a)

Submission status: Runtime Error

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

def Euc(x,y):
    s=0;b=0;rem=0;
    if x>y:
        s=y;b=x
    elif y>x:
        s=x;b=y
    else:
        return x
    while True:
        rem = b%s
        if rem == 0:
            return int(x*y/s)
        b = s
        s = rem
a = lis[0]
for i in range(N-1):
    a = Euc(a,lis[i+1])
print(a)

Submission status: Runtime Error

Solution code:
from math import gcd

N = int(input())
T = [int(input()) for i in range(N)]
ans = T[0]
def lcm(a, b):
    g = gcd(a, b)
    return a * b // g

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

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python

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

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

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

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

Submission status: Runtime Error

Solution code:
def gcd(x,y):
	if x < y:
		x,y = y,x
	while y > 0:
		r = x % y
		x = y
		y = r
	return x

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

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

print(int(ans))

Submission status: Runtime Error

Solution code:
def gcd(x,y):
	if x < y:
		x,y = y,x
	while y > 0:
		r = x % y
		x = y
		y = r
	return x

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

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

print(int(ans))

Submission status: Runtime Error

Solution code:
# list: ソート済配列
# n: 参照番号
@profile
def gcd(list, n):
    if n == 0:
        return list[0]
    else:
        a, b = list[n-1], list[n]
        
        while list[n]:
            list[n-1], list[n] = list[n], list[n-1] % list[n]

        list[n-1] = (a*b)/list[n-1]
        return gcd(list, n-1)

N = int(input())
T = [int(input()) for i in range(N)]
T.sort(reverse=True)
print(int(gcd(T, N-1)))

Submission status: Runtime Error

Solution code:
A, B, C, D = map(int, input().split())
value = min(B, D) - max(A, C)
print(value if value > 0 else "0")

Submission status: Runtime Error

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

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

print(ans)

Submission status: Runtime Error

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

print(int(ans))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import math
import sys
import itertools
import numpy as np
import functools
import collections
mo = 1000000007
INF = 10**100
r = range

class infix(object):
    def __init__(self, function):
        self.function = function

    def __ror__(self, other):
        self.left = other
        return self

    def __or__(self, other):
        return self.function(self.left, other)

    def __call__(self, value1, value2):
        return self.function(value1, value2)

@infix
def c(f_t_u, f_u_r): return lambda t: f_u_r(f_t_u(t))

class _Ap(object):
    def __rlshift__(self, other):
        self.value = other
        return self

    def __rshift__(self, other):
        return other(self.value)
Ap = _Ap()
A = Ap

#d = {1:2, 3:5, 6:10, 1000043:3814}
#zip(d.keys(), d.values())<<ap>>(list |c| sorted |c| reversed |c| list |c| print)

n=input()<<A>>int
ret = 1
for i in range(n): a=int(input()); ret = ret * a // math.gcd(ret, a)
print(ret);

Submission status: Runtime Error

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

A1 = set(A0)
A = list(A1)  
Amax = max(A)
A.remove(Amax)
can = Amax
end = 0

while end == 0:
    count = 1
    while True:
        if can*count%A[-1]!=0:
            count += 1
        else:
            can *= count
            del A[-1]
            if A == []:
                end = 1
            break
            
print(can)

Submission status: Runtime Error

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

if N == 1:
    print(T0[0])
else:
    T = list(set(T0))

    Tmax, Tsec = T[-1], T[-2]
    can1 = 1
    count0 = 1

    while True:
        can = Tmax * count0
    
        if can%Tsec==0:
            can1 = can
            break
        
        count0 += 1
    

    count = 1

    while True:
        can = can1 * count
    
        for Ti in T:
            if can%Ti!=0:
                break
        else:
            print(can)
            break
        
        count += 1

Submission status: Runtime Error

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

T = list(set(T0))

Tmax, Tsec = T[-1], T[-2]
can1 = 1
count0 = 1

while True:
    can = Tmax * count0
    
    if can%Tsec==0:
        can1 = can
        break
        
    count0 += 1
    

count = 1

while True:
    can = can1 * count
    
    for Ti in T:
        if can%Ti!=0:
            break
    else:
        print(can)
        break
        
    count += 1

Submission status: Runtime Error

Solution code:
from sys import stdin, stdout
from collections import defaultdict
def readLine_int_list(): return list(map(int, stdin.readline().split()))
def readAll_int(): return list(map(int, stdin))

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 = sorted(list(set(readAll_int())))
    t = readAll_int()
    for i in range(len(t) - 1):
        a = lcm(t[i], t[i+1])
        t[i+1] = a
    print(a)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
from sys import stdin, stdout
from collections import defaultdict
def readLine_int_list():return list(map(int, stdin.readline().split()))
def readLine_int_list_reverse(): return list(map(int, stdin.readline().split())).reverse()
def readAll_int(): return list(map(int, stdin))
def readLine_str_list():return list(map(int, stdin.readline().split()))
def readAll_str(): return list(map(int, stdin))
def g_twoD_list(p,q): return [[0 for i in range(p)] for j in range(q)]


from sys import stdin, stdout
from collections import defaultdict
def readLine_int_list(): return list(map(int, stdin.readline().split()))
def readAll_int(): return list(map(int, stdin))

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 = list(set(readAll_int()))
    for i in range(len(t) - 1):
        a = lcm(t[i], t[i+1])
        t[i+1] = a
    print(a)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
from sys import stdin, stdout
from collections import defaultdict
def readLine_int_list():return list(map(int, stdin.readline().split()))
def readAll_int(): return list(map(int, stdin))

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 = sorted(list(set(readAll_int())))
    for i in range(len(t) - 1):
        a = lcm(t[i], t[i+1])
        t[i+1] = a
    print(a)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
deploy = True
if not deploy:
    with open('input.txt', 'r') as f:
        fid = list(map(lambda x: int(x.rstrip()), f.readlines()))
    Ti = fid[1:]
    n = int(fid[0])
else:
    n = int(input())

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

Max = max(Ti)

while True:
    m = [Max for i in range(n)]
    d = [x % y for x, y in zip(m, Ti)]

    if d == [0 for i in range(n)]:
        break

    Max += max(Ti)

print(Max)

Submission status: Runtime Error

Solution code:
deploy = False
if not deploy:
    with open('input.txt', 'r') as f:
        fid = list(map(lambda x: int(x.rstrip()), f.readlines()))
    Ti = fid[1:]
    n = int(fid[0])
else:
    n = int(input())

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

Max = max(Ti)

while True:
    m = [Max for i in range(n)]
    d = [x % y for x, y in zip(m, Ti)]

    if d == [0 for i in range(n)]:
        break

    Max += max(Ti)

print(Max)

Submission status: Runtime Error

Solution code:
deploy = True
if not deploy:
    with open('input.txt', 'r') as f:
        fid = list(map(lambda x: int(x.rstrip()), f.readlines()))
    Ti = fid[1:]
    n = int(fid[0])
else:
    n = int(input())

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

Max = max(Ti)

while True:
    m = [Max for i in range(n)]
    d = [x % y for x, y in zip(m, Ti)]

    if d == [0 for i in range(n)]:
        break


    Max *= 2

print(Max)

Submission status: Runtime Error

Solution code:
import sys

if __name__ == '__main__':
    N = int(input())
    T = []
    for i in range(N):
        T.append(int(input()))
    maxT = max(T)
    i = maxT
    while i <10*18
        k = 0
        for j in range(N):
            if (i%T[j]) == 0:
                k += 1
            else:
                break
        if k == N:
            print(i)
            sys.exit()
        else:
            i += maxT

Submission status: Runtime Error

Solution code:
if __name__ == '__main__':
    N = int(input())
    T = list(map(int, input().split()))

    for i in range(10**18):
        k = 0
        for j in range(N):
            if (i%T[j]) == 0:
                k += 1
        if k == N:
            print(i)
            return

Submission status: Runtime Error

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

def get_lcm(a, b):
    return int(a*b / get_gcd(a, b))

N = int(input())
T = list()
for i in range(N):
    T.append(int(input()))
if len(T) == 1:
    T[1] = 0
lcm = get_lcm(T[0], T[1])
for i in range(N-2):
    lcm = get_lcm(lcm, T[i+2])
print(lcm)

Submission status: Runtime Error

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

def get_lcm(a, b):
    return int(a*b / get_gcd(a, b))

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

Submission status: Runtime Error

Solution code:
N = int(input())
T= [0]*N
for i in range(N):
    T[i] = int(input())
T.sort(reverse=True)
def gcd(n,m):
    while m != 0:
        n , m = m , n%m
    return n
def lcm(n,m):
     x = (n/gcd(n,m))*m
     return int(x)
ans = T[0]
for i in range(1,N):
    ans = lcm(ans,T[i])
print(ans)

Submission status: Runtime Error

Solution code:
s=set()
n=int(input())
for i in range(n):
    s.add(int(input()))
while len(s) != 1:
    l=list(cb(s,2))
    s = set([lcm(x,y) for x,y in l])
print(list(s)[0])

Submission status: Runtime Error

Solution code:
def euclid(a,b):
	if b == 0:
		return a
	else:
		return euclid(b,a % b)
		
n = int(input())
t = []
for i in range(n):
	x = int(input())
	t.append(x)

for i in range(0,n-1):
	t[i+1] = t[i] * t[i+1] / euclid(t[i],t[i+1])

print(int(t[n-1]))

Submission status: Runtime Error

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

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

result = lcm(T[0],T[1])

for x in range(2,N):
    result = lcm(result, T[x])

print(result)

Submission status: Runtime Error

Solution code:
def gcd(a,b):
    a=min(a,b)
    b=max(a,b)
    while b:
        a,b= b, a%b
    return a

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

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

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

Submission status: Runtime Error

Solution code:
import math
n = int(input())
t = [int(input()) for i 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[n - 1])

Submission status: Runtime Error

Solution code:
import math
n=int(input())
cnt=0
t=[]
u={}
while cnt<n:
    num=[int(input())]
    t+=num
    cnt+=1

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

ans=1

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

print(ans)

Submission status: Runtime Error

Solution code:
import sys

N = int(raw_input())
array = []
for i in range(N):
    array.append(int(raw_input()))

array.sort()

def euclid(a, b):
    if a == b:
        return a
    if a > b:
        return euclid(a - b, b)
    else:
        return euclid(b - a, a)

result = array[0]
for i in array[1:]:
    result = result * i / euclid(result, i)
print result

Submission status: Runtime Error

Solution code:
from functools import reduce
from math import gcd

n = int(input())
clocks = []
for i in range(n):
    clocks.append(int(input()))
print(reduce(lambda x, y: (x * y) // gcd(x, y), clocks))

Submission status: Runtime Error

Solution code:
from functools import reduce
from math import gcd

n = int(input())
clocks = []
for i in range(n):
    clocks.append(int(input()))
print(reduce(lambda x, y: (x * y) // gcd(x, y), clocks, 1))

Submission status: Runtime Error

Solution code:
from fractions import gcd

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

res = 1
for t in T:
  res = int(res/(gcd(res, t))) * t
print(res)

Submission status: Runtime Error

Solution code:
from fractions import gcd

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

res = 1
for t in T:
  res = int(res * t /(gcd(res, t)))
print(res)

Submission status: Runtime Error

Solution code:
from fractions import gcd

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

res = 1L
for t in T:
  res = long(res * t /(gcd(res, t)))
print(res)

Submission status: Runtime Error

Solution code:
from math import gcd

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

res = 1L
for t in T:
  res = long(res * t /(gcd(res, t)))
print(res)

Submission status: Runtime Error

Solution code:
from math import gcd

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

res = 1
for t in T:
  res = int(res * t /(gcd(res, t)))
print(res)

Submission status: Runtime Error

Solution code:
import math

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


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


res = T[0]
for t in T:
    res = lcm(res, t)

print(res)

Submission status: Runtime Error

Solution code:
from functools import reduce

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())
t = [int(input()) for i in range(n)]

x = reduce(t, lcm)

print(x)

Submission status: Runtime Error

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())
T=[int(input()) for i in range(N)]
T.sort()
G=T[1]
for i in range(N):
  G=lcm(G,T[i])
print(G)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

# def gcd(a, b):
#     if b==0:
#         return(a)
#     return(gcd(b, a%b))
def gcd(a, b):
    while b > 0:
        t = a
        a = b
        b = t%b
    return(a)

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

LCM = T[0]
for i in range(n-1):
    LCM = lcm(LCM, T[i+1])

print(LCM)

Submission status: Runtime Error

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

# def gcd(a, b):
#     if b==0:
#         return(a)
#     return(gcd(b, a%b))
def gcd(a, b):
    while b > 0:
        t = a
        a = b
        b = t%b
    return(a)

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

LCM = T[0]
for i in range(n-1):
    LCM = lcm(LCM, T[i+1])

print(int(LCM))

Submission status: Runtime Error

Solution code:
n = int(input())
T = []
for i 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))

LCM = T[0]
for i in range(n-1):
    LCM = lcm(LCM, T[i+1])

print(int(LCM))

Submission status: Runtime Error

Solution code:
def gcd(a,b):
    m = max(a,b)
    n = min(a,b)
    if n==0:
        return m
    return gcd(n, m%n)

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

N = input()
Ti = []

for i in range(int(N)):
    tmp = input()
    Ti.append(int(tmp))
Ti.sort()

ans_lcm = lcm(Ti[0],Ti[1])
for i in range(2,len(Ti)):
    ans_lcm = lcm(ans_lcm,Ti[i])
print(int(ans_lcm))

Submission status: Runtime Error

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

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

N = input()
Ti = []

for i in range(int(N)):
    tmp = input()
    Ti.append(int(tmp))
Ti.sort()

ans_gcd = gcd(Ti[0],Ti[1])
ans_lcm = lcm(Ti[0],Ti[1],ans_gcd)
for i in range(2,len(Ti)):
    ans_gcd = gcd(ans_gcd,Ti[i])
    ans_lcm = lcm(ans_lcm,Ti[i],ans_gcd)

print(int(ans_lcm))

Submission status: Runtime Error

Solution code:
N = input()
Ti = []

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

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

for i in range(int(N)):
    tmp = input()
    Ti.append(int(tmp))
Ti.sort()

ans_gcd = gcd(Ti[0],Ti[1])
ans_lcm = lcm(Ti[0],Ti[1])
for i in range(2,len(Ti)):
    ans_gcd = gcd(ans_gcd,Ti[i])
    ans_lcm = lcm(ans_lcm,Ti[i])

print(int(ans_lcm))

Submission status: Runtime Error

Solution code:
N = input()
Ti = []

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

for i in range(int(N)):
    tmp = input()
    Ti.append(int(tmp))
Ti.sort()

ans_gcd = gcd(Ti[0],Ti[1])
ans_lcm = (Ti[0]*Ti[-1])/ans_gcd
for i in range(2,len(Ti)):
    ans_gcd = gcd(ans_gcd,Ti[i])
    ans_lcm = (ans_gcd*Ti[-1])/ans_gcd

print(int(ans_lcm))

Submission status: Runtime Error

Solution code:
N = input()
Ti = []

def gcd(a,b):
    gcd = 1
    for i in range(2,a+1):
        if a%i == 0 and b%i == 0:
            gcd = i
    return gcd

for i in range(int(N)):
    tmp = input()
    Ti.append(int(tmp))
Ti.sort()

ans_gcd = gcd(Ti[0],Ti[1])
ans_lcm = (Ti[0]*Ti[-1])/ans_gcd
for i in range(2,len(Ti)):
    ans_gcd = gcd(ans_gcd,Ti[i])
    ans_lcm = (ans_gcd*Ti[-1])/ans_gcd

print(int(ans_lcm))

Submission status: Runtime Error

Solution code:
import math

def gcd(x, y):
    if x < y:
        x,y=y,x
    while y > 0:
        r = x % y
        x = y
        y = r
    return x
N=int(input())
T0=1
for _ in range(N):
    T=int(input())
    T0=int(T0/gcd(T0,T)*T)
print(T0)

Submission status: Runtime Error

Solution code:
def gcd(x, y):
    if x < y:
        x,y=y,x
    while y > 0:
        r = x % y
        x = y
        y = r
    return x
N=int(input())
T0=1
for _ in range(N):
    T=int(input())
    T0=int(T*T0/gcd(T0,T))
print(T0)

Submission status: Runtime Error

Solution code:
#coding=UTF-8
import math

N=int(input())
ans=1
for idx in range(0,N,1):
    T=int(input())
    ans=ans*T// math.gcd(ans,T)

print(ans)

Submission status: Runtime Error

Solution code:
import math

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

Submission status: Runtime Error

Solution code:
def gcd(a, b):
    """Return greatest common divisor using Euclid's Algorithm."""
    while b:      
        a, b = b, a % b
    return a

def lcm(a, b):
    """Return lowest common multiple."""
    return a * b // gcd(a, b)

N = int(input())
if N > 1:
    T = int(input())
for i in range(1, N):
    T = lcm(int(input()), T)
print(T)