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:
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 int(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[i-2],t_list[i]))
print(ans_list[-1])

Submission status: Runtime Error

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 int(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
    elif i == 1:
        ans_list.append(lcm(t_list[0] , t_list[1]))
    
    else:
        ans_list.append(lcm(ans_list[i-2],t_list[i]))
print(ans_list[-1])

Submission status: Runtime Error

Solution code:
def fcd(a , b):
    if b == 0:
        return 0
    
    if a == 0:
        return 0
    
    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 int(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:
        continue
    elif i == 1:
        ans_list.append(lcm(t_list[0] , t_list[1]))
    
    else:
        ans_list.append(lcm(ans_list[i-2],t_list[i]))
print(ans_list[-1])

Submission status: Runtime Error

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 int(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:
        continue
    elif i == 1:
        ans_list.append(lcm(t_list[0] , t_list[1]))
    
    else:
        ans_list.append(lcm(ans_list[i-2],t_list[i]))
print(ans_list[-1])

Submission status: Runtime Error

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


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

Submission status: Runtime Error

Solution code:
for i in range(len(t_list)):
    if i == 0:
        continue
    elif i == 1:
        ans_list.append(lcm(t_list[0] , t_list[1]))
    
    else:
        ans_list.append(lcm(ans_list[i-2],t_list[i]))
        
print(ans_list[-1])

Submission status: Runtime Error

Solution code:
from math import gcd
from functools import reduce

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

def multi(x,y):
	return x*y

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


print(reduce(lcm,t))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def gcd(a, b):
    return a if b == 0 else gcd(b,a%b)
n = int(input())
t = []
mul = 1
for i in range(n):
    tt = int(input())
    mul *= tt
    t.append(tt)
lcm = t[0]
for i in t[1:]:
    lcm = lcm*i/gcd(lcm, i)
print(int(lcm))

Submission status: Runtime Error

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

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[1:]:
    res = lcm(res, T)
print(int(res))

Submission status: Runtime Error

Solution code:
from functools import reduce
import math


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


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

Submission status: Runtime Error

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

#入力tについて、最小公倍数を求めればそれが答えとなる
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 
n = int(input())
t = [int(input()) for i in range(n)]

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

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

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

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


print(ans)

Submission status: Runtime Error

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
    elif num1 == 0:
        return 1
    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: Runtime Error

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

Solution code:
import sys
sys.setrecursionlimit(2000000)

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

Solution code:
import sys
sys.setrecursionlimit(2000000)

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 = []
for num1 in NUMS:
    for num2 in NUMS:
        if num1 == num2:
            continue
        res.append(int(num1  * num2 / gcd(num1, num2)))

print(max(res))

Submission status: Runtime Error

Solution code:
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 = []
for num1 in NUMS:
    for num2 in NUMS:
        if num1 == num2:
            continue
        res.append(int(num1  * num2 / gcd(num1, num2)))

print(max(res))

Submission status: Runtime Error

Solution code:
from fractions import gcd
def lcm(list):
    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: Runtime Error

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

Submission status: Runtime Error

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

from math import gcd

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

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

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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(n-1):
    ans = int(ans * t[i+1] / gcd(ans , t[i+1]))
    
print(int(ans))

Submission status: Runtime Error

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

Solution code:
import math
from functools import reduce
N=int(input())
list=[]
for a in range(N):
    T=int(input())
    list.append(T)
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
print(lcm(*list))

Submission status: Runtime Error

Solution code:
import math
N=int(input())
list=[]
for a in range(N):
    T=int(input())
    list.append(T)
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
print(lcm(*list))

Submission status: Runtime Error

Solution code:
import math
from functools import reduce
N=int(input())
list=[]
for a in range(N):
    T=int(input())
    if T in list:
        continue
    else:
        list.append(T)
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
print(lcm(*list))

Submission status: Runtime Error

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

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

for i in range(n):
  for j in range(i+1, n):
    if t[i] == 1:
      break
    t[i] //= gcd(t[i], t[j])

ans = 1
[ans *= x for x in t]
print(ans)

Submission status: Runtime Error

Solution code:
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
n=int(input())
ans=1
tmp1=int(input())
for i in range(n-1):
    tmp2=int(input())
    ans=lcm(tmp1,tmp2)
    tmp1=ans
print(ans)

Submission status: Runtime Error

Solution code:
from math 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: Runtime Error

Solution code:
N = int(input())

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

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

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

Submission status: Runtime Error

Solution code:
N = int(input())

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

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

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

Submission status: Runtime Error

Solution code:
N = int(input())
num = int(input())
div_t = 0

for i in range(N-1):
    T = int(input())
    if(max(T, num)%min(T, num) == 0):
        div_T = max(T, num)
    else:
        for j in range(2, 10**18+1):
            if(max(T, num)*j % min(T, num) == 0):
                div_T = max(T, num)*j
                break
print(div_T)

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)

ans = t[0]

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

print(ans)

Submission status: Runtime Error

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

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

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

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

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())
t0=int(input())
t1=int(input())
t_lcm=lcm(t0,t1)
for i in range(n-2):
    t2=int(input())
    t_lcm=lcm(t_lcm,t2)
print(t_lcm)

Submission status: Runtime Error

Solution code:
# coding: utf-8

def get_kouyaku(num1:int, num2:int):
    if num1 % num2 == 0:
        return num2
    return get_kouyaku(num2, num1%num2)

def get_koubai(num1:int, num2:int):
    kouyaku = get_kouyaku(num1, num2)
    return int(kouyaku * (num1/kouyaku) * (num2/kouyaku))

clock_count = int(input())
clock = [int(input()) for i in range(clock_count)]

ans = 1
for i in clock:
    ans = get_koubai(ans, i)

print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
t=list(set([int(input()) for _ in range(n)]))
T,l=max(t),len(t)

def f(j):
  for i in range(l):
    if (T*j)%t[i]!=0:
      return f(j+1)
      break
  return T*j

print(f(1))

Submission status: Runtime Error

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

def f(j):
  T=max(t)
  for i in range(len(t)):
    if (T*j)%t[i]!=0:
      return f(j+1)
      break
  return T*j

print(f(1))

Submission status: Runtime Error

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

def f(j):
  T=max(t)
  for i in range(len(t)):
    if (T*j)%t[i]!=0:
      j+=1
      return f(j+1)
      break
  return T*j

print(f(1))

Submission status: Runtime Error

Solution code:
from math import gcd
from itertools import accumulate
def GCD(args):
    return list(accumulate(args,gcd))[-1]
N = int(input())
T = [int(input()) for _ in range(N)]
g = GCD(T)
ans = g
for t in T:
    ans *= t//g
print(ans)

Submission status: Runtime Error

Solution code:
from math import gcd
from itertools import accumulate
def GCD(*args):
    return list(accumulate(*args,gcd))[-1]
N = int(input())
T = [int(input()) for _ in range(N)]
g = GCD(T)
ans = g
for t in T:
    ans *= t//g
print(ans)

Submission status: Runtime Error

Solution code:
from math import gcd
from itertools import accumulate
def GCD(*args):
    return list(accumulate(*args,gcd))[-1]
def LCM(*args):
    g = GCD(args)
    return list(accumulate([x//g for x in list(args)], lambda x,y:x*y))[-1]*g
_,*T = open(0)
print(LCM(*map(int,T)))

Submission status: Runtime Error

Solution code:

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

Submission status: Runtime Error

Solution code:

import fractions

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

Submission status: Runtime Error

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):
    t=int(input())
    ans=lcm(ans,t)
print(ans)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

ll LCM(ll a, ll b) {
  ll GCD = 1;
  if (max(a, b) % min(a, b) == 0) {
    return max(a, b);
  }
  else {
  	for (ll i = 1; i <= min(a, b) / 2; i++) {
      if (a % i == 0 && b % i == 0) {
        GCD = i;
      }
    }
  }
  return a / GCD * b;
}

int main() {
  int N;
  cin >> N;
  vector<ll>T(N);
  ll ans = 1;
  for (int i = 0; i < N; i++) {
    cin >> T.at(i);
    ans = LCM(ans, T.at(i));
  }
  cout << ans;
}

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(*numbers):
    return reduce(lcm_base, numbers, 1)

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

#print(lcm(27, 18, 9, 3))
n=int(input())
ab = []
for _ in range(n):
    a= int(input())
    ab.append(a)
print(lcm_list(ab))

Submission status: Runtime Error

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


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


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


ret = lcm(lst[0], lst[1])
for x in lst[2:]:
    ret = lcm(ret, x)
print(ret)

Submission status: Runtime Error

Solution code:

import math
N=int(input())

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

cal = T[0]

i = 1
now = T[0]
while(i<N):
    m = T[i] * now
    now = m // math.gcd(now, T[i])
    i+=1
print(now)

Submission status: Runtime Error

Solution code:
#import math  
import fractions
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) // functools.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
ans = lcm_list(T)

print(ans)

Submission status: Runtime Error

Solution code:
import fractions
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) // functools.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
ans = lcm_list(T)

print(ans)

Submission status: Runtime Error

Solution code:
import fractions
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, 1)
ans = lcm_list(T)

print(ans)

Submission status: Runtime Error

Solution code:
import sys
import fractions

n=int(input())
list=[]
count=1
ans=1
for i in range(n):
	t=int(input())
	if not t in list:
		list.append(t)
		count*=t
		ans = fractions.gcd(ans, list[i])
print(count//ans)

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
#define watch(x) cout << (#x) << " is " << (x) << endl
typedef long long ll;
using namespace std;
int static fast = [](){
  ios::sync_with_stdio(false);
  cin.tie(0); cout.tie(0); return 0;
}();
// freopen("input.txt", "r", stdin);

int main() {
    int n;
    cin >> n;
    vector<ll> arr(n, 0);
    for(ll& val: arr)
        cin >> val;
    ll ans = lcm(arr[0], arr[1]);
    for(int i = 2; i < n; i++) {
        ll tmp = __gcd(ans, arr[i]);
        ans = ans/tmp * arr[i];
    }
    cout << ans << endl;
    return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import fractions

def a(A, B):
    C = fractions.gcd(A, B)
    return int((A * B)/C)

N = int(input())

T = []

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

T = sorted(T)
C = T[0]

if N > 1:
    for i in range(1, N):
        C = a(C, T[i])
print(C)

Submission status: Runtime Error

Solution code:
import fractions

def a(A, B):
    C = fractions.gcd(A, B)
    return int((A * B)/C)

N = int(input())

T = []

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

T = sorted(T)
C = T[0]

for i in range(1, N):
    C = a(C, T[i])
print(C)

Submission status: Runtime Error

Solution code:
import sys
import numpy as np

# N 時計の数
n = int(input())

# Ti 各時計が1周する秒数
t = []
for i in range(n):
    t.append(int(input()))
    
# 最大公約数を求める
def gcb(a, b):
    if b == 0:
        return a
    return int(gcb(b, a % b))

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

ans = 1

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

print(int(ans))

Submission status: Runtime Error

Solution code:
import sys
import numpy as np

# N 時計の数
n = int(input())

# Ti 各時計が1周する秒数
t = []
for i in range(n):
    t.append(int(input()))
    
# 最大公約数を求める
def gcb(a, b):
    if b == 0:
        return a
    return gcb(b, a % b)

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

ans = 1

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

print(int(ans))

Submission status: Runtime Error

Solution code:
#####################
#複数の最小公倍数lcm
#####################
from fractions import gcd
def Lcm(list):
  for a in list:
    L = (a // gcd(a, L))*L
  return L
n= int(input())
A = [int(input()) for i in range(n)]
# A = [2,6,8]
print(Lcm(A))

Submission status: Runtime Error

Solution code:
n=int(input())
ans=1
a=[0]*3
for i in range(n):
    a[0]=int(ans)
    a[1]=temp=int(input())
    while 1:
        a[2]=int(a[0]%a[1])
        a[0]=a[1]
        a[1]=a[2]
        if a[2]==0:break
    ans=ans*temp/a[0]
print(int(ans))

Submission status: Runtime Error

Solution code:
n=int(input())
ans=1
a=[0]*3
for i in range(n):
    a[0]=ans
    a[1]=temp=int(input())
    while 1:
        a[2]=int(a[0]%a[1])
        a[0]=a[1]
        a[1]=a[2]
        if a[2]==0:break
    ans=ans*temp/a[0]
print(int(ans))

Submission status: Runtime Error

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

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

result=1
for num in S:
    result = lcm(result,num)
print(result)

Submission status: Runtime Error

Solution code:
from fraction import gcd
n=int(input())
t=[]
for _ in range(n):
    a=int(input())
    t.append(a)
def lcm_base(x,y):
    return (x*y // gcd(x,y))
def lcm_list(l):
    return reduce(lcm_base,l,1)

Submission status: Runtime Error

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

# GCD -- START --
def gcd(x,y):
  if y==0:
    return x
  return gcd(y,x%y)
# GCD --- END ---

# LCM -- START --
def lcm(x,y):
  return x*y/gcd(x,y)
# LCM --- END ---

def main():
  n=I()
  ans=I()

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

  return ans

# main()
print(main())

Submission status: Runtime Error

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

# GCD -- START --
def gcd(x,y):
  while y:
    x,y=y,x%y
  return x
# GCD --- END ---

# LCM -- START --
def lcm(x,y):
  return x/gcd(x,y)*y
# LCM --- END ---

def main():
  n=I()
  ans=I()

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

  return ans

# main()
print(main())

Submission status: Runtime Error

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

# GCD -- START --
def gcd(x,y):
  while y:
    x,y=y,x%y
  return x
# GCD --- END ---

# LCM -- START --
def lcm(x,y):
  return x*y/gcd(x,y)
# LCM --- END ---

def main():
  n=I()
  ans=I()

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

  return ans

# main()
print(main())

Submission status: Runtime Error

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

# GCD -- START --
def gcd(x,y):
  while y:
    x,y=y,x%y
  return x
# GCD --- END ---

# LCM -- START --
def lcm(x,y):
  return int(x*y/gcd(x,y))
# LCM --- END ---

def main():
  n=I()
  ans=I()

  for _ in range(n-1):
    ans=lcm(ans,I())

  return ans

# main()
print(main())

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!
import fractions
N=int(input())
t=int(input())
l=[t]
for i in range(N-1):
    t1=int(input())
    l.append(t1)
    g=fractions.gcd(t,t1)
    t=g
ans=1
for i in range(N):
    ans*=l[i]

ans=ans//g

print(ans)

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!
import fractions
N=int(input())
t=int(input())
for i in range(N-1):
    t1=int(input())
    g=fractions.gcd(t,t1)
    ans=g*t*t1
    t=g
print(ans)

Submission status: Runtime Error

Solution code:
# coding: utf-8
import math

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

N=int(input())
ans=lcm(1,int(input()))

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

print(ans)

Submission status: Runtime Error

Solution code:
def GCM( q,r ): #ユークリッドの互除法，最大公約数
	if q < r:
		q, r = r, q
	while( r>0 ):
		q, r = r, q%r
	return q

def LCM( a,b ):
	return int(a / GCM(a,b) * b)

if __name__ == '__main__':
	N = int(input())
	a = 1
	for i in range(0,N):
		t = int(input())
		a = LCM(a, t)
	print(a)

Submission status: Runtime Error

Solution code:
def GCM( q,r ): #ユークリッドの互除法，最大公約数
	if q < r:
		q, r = r, q
	while( r>0 ):
		q, r = r, q%r
	return q

def LCM( a,b ):
	return int(a * b / GCM(a,b))

if __name__ == '__main__':
	N = int(input())
	a = 1
	for i in range(0,N):
		t = int(input())
		a = LCM(a, t)
	print(a)

Submission status: Runtime Error

Solution code:
def GCM( q,r ): #ユークリッドの互除法，最大公約数
	if q < r:
		q, r = r, q
	while( r>0 ):
		q, r = r, q%r
	return q

def LCM( a,b ):
	return int(a / GCM(a,b) * b)

if __name__ == '__main__':
	N = int(input())
	time_lst = []
	for i in range(0,N):
		t = int(input())
		time_lst.append(t)
	a = 1
	for i in time_lst:
		a = LCM(a, i)
	print(a)

Submission status: Runtime Error

Solution code:
def GCM( q,r ): #ユークリッドの互除法，最大公約数
	if q < r:
		q, r = r, q
	while( r>0 ):
		q, r = r, q%r
	return q

def LCM( a,b ):
	return int(a / GCM(a,b) * b)

if __name__ == '__main__':
	n = int(input())
	a = int(input())
	for i in range(0,n-1):
		a = lcm(a, int(input()))
	print(a)

Submission status: Runtime Error

Solution code:
def GCM( q,r ): #ユークリッドの互除法，最大公約数
	if q < r: q, r = r, q
	while( r>0 ): q, r = r, q%r
	return q

def LCM( a,b ):
	return int(a / GCM(a,b) * b)

if __name__ == '__main__':
	n = int(input())
	a = int(input())
	for i in range(0,n-1): a = lcm(a, int(input()))
	print(a)

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
from fractions import gcd
n = int(input())
times = [int(input()) for _ in range(n)]

if n == 1:
    print(times[0])
else:
    prev_lcm = times[0]
    for t in times[1:]:
        tmp = gcd(prev_lcm, t)
        lcm = int(prev_lcm * t / tmp)
        prev_lcm = lcm
    print(lcm)

Submission status: Runtime Error

Solution code:
from fractions import gcd
n = int(input())
times = [int(input()) for _ in range(n)]

prev_lcm = times[0]
for t in times[1:]:
    tmp = gcd(prev_lcm, t)
    lcm = int(prev_lcm * t / tmp)
    prev_lcm = lcm
if n == 1:
    print(times[0])
else:
    print(lcm)

Submission status: Runtime Error

Solution code:
from fractions import gcd
n = int(input())
times = [int(input()) for _ in range(n)]

prev_lcm = times[0]
for t in times[1:]:
    tmp = gcd(prev_lcm, t)
    lcm = int(prev_lcm * t / tmp)
    prev_lcm = lcm
print(lcm)

Submission status: Runtime Error

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

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