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 gcd(a, b):
    while b:
        a, b = b, a % b
    return a


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


n = int(input())
# つまり全t[i]で割り切れる値を出せということ
# 最小公倍数を出せばよい
t = [0 for i in range(n)]
for i in range(n):
    t[i] = int(input())
sum = t[0]
for i in range(1, n):
    # print("sum:{} t:{} lcm:{}".format(sum, t, lcm(sum, t)))
    sum = lcm(sum, t[i])
    # print(sum)
print(sum)
"""
# 入力 : 自然数     ex) 12
# 出力 : 約数リスト ex) [2, 2, 3]
def factorization(n):
    R = int(n)
    s = 0
    L = []
    div = 2
    first = True
    while s == 0:
        for i in range(div, R + 1):
            if n % i == 0:
                n = n / i
                if i == div and not first:
                    alreadyExist = True
                else:
                    alreadyExist = False
                first = False
                div = i
                if n == 1:
                    s = 1
                if alreadyExist:
                    L[-1][1] += 1
                else:
                    L.append([i, 1])
                break
    return L


n = int(input())
t = [0 for i in range(n)]
fact = []
for i in range(n):
    # print(i)
    t[i] = int(input())
    if i == 0:
        fact = factorization(t[i])
    else:
        tmpFact = factorization(t[i])
        for _tmpFact in tmpFact:
            for _fact in fact:
                if _fact[0] == _tmpFact[0]:
                    _fact[1] = max(_fact[1], _tmpFact[1])
                    break
                elif _fact[0] == fact[-1][0]:
                    fact.append(_tmpFact)
# つまり全t[i]で割り切れる値を出せということ
# 最小公倍数を出せばよい
sum = 1
for _fact in fact:
    sum *= _fact[0]**_fact[1]
print(sum)
"""

Submission status: Runtime Error

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


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


n = int(input())
# つまり全t[i]で割り切れる値を出せということ
# 最小公倍数を出せばよい
t = [0 for i in range(n)]
for i in range(n):
    t[i] = int(input())
sum = t[0]
for i in range(1, n):
    # print("sum:{} t:{} lcm:{}".format(sum, t, lcm(sum, t)))
    sum = lcm(sum, t[i])
    # print(sum)
print(sum)
"""
# 入力 : 自然数     ex) 12
# 出力 : 約数リスト ex) [2, 2, 3]
def factorization(n):
    R = int(n)
    s = 0
    L = []
    div = 2
    first = True
    while s == 0:
        for i in range(div, R + 1):
            if n % i == 0:
                n = n / i
                if i == div and not first:
                    alreadyExist = True
                else:
                    alreadyExist = False
                first = False
                div = i
                if n == 1:
                    s = 1
                if alreadyExist:
                    L[-1][1] += 1
                else:
                    L.append([i, 1])
                break
    return L


n = int(input())
t = [0 for i in range(n)]
fact = []
for i in range(n):
    # print(i)
    t[i] = int(input())
    if i == 0:
        fact = factorization(t[i])
    else:
        tmpFact = factorization(t[i])
        for _tmpFact in tmpFact:
            for _fact in fact:
                if _fact[0] == _tmpFact[0]:
                    _fact[1] = max(_fact[1], _tmpFact[1])
                    break
                elif _fact[0] == fact[-1][0]:
                    fact.append(_tmpFact)
# つまり全t[i]で割り切れる値を出せということ
# 最小公倍数を出せばよい
sum = 1
for _fact in fact:
    sum *= _fact[0]**_fact[1]
print(sum)
"""

Submission status: Runtime Error

Solution code:
"""
def gcd(m, n):
    x = max(m, n)
    y = min(m, n)
    if x % y == 0:
        return y
    else:
        while x % y != 0:
            z = x % y
            x = y
            y = z
        else:
            return z
"""


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


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


n = int(input())
# つまり全t[i]で割り切れる値を出せということ
# 最小公倍数を出せばよい
sum = int(input())
for i in range(1, n):
    t = int(input())
    # print("sum:{} t:{} lcm:{}".format(sum, t, lcm(sum, t)))
    sum = lcm(sum, t)
print(sum)
"""
# 入力 : 自然数     ex) 12
# 出力 : 約数リスト ex) [2, 2, 3]
def factorization(n):
    R = int(n)
    s = 0
    L = []
    div = 2
    first = True
    while s == 0:
        for i in range(div, R + 1):
            if n % i == 0:
                n = n / i
                if i == div and not first:
                    alreadyExist = True
                else:
                    alreadyExist = False
                first = False
                div = i
                if n == 1:
                    s = 1
                if alreadyExist:
                    L[-1][1] += 1
                else:
                    L.append([i, 1])
                break
    return L


n = int(input())
t = [0 for i in range(n)]
fact = []
for i in range(n):
    # print(i)
    t[i] = int(input())
    if i == 0:
        fact = factorization(t[i])
    else:
        tmpFact = factorization(t[i])
        for _tmpFact in tmpFact:
            for _fact in fact:
                if _fact[0] == _tmpFact[0]:
                    _fact[1] = max(_fact[1], _tmpFact[1])
                    break
                elif _fact[0] == fact[-1][0]:
                    fact.append(_tmpFact)
# つまり全t[i]で割り切れる値を出せということ
# 最小公倍数を出せばよい
sum = 1
for _fact in fact:
    sum *= _fact[0]**_fact[1]
print(sum)
"""

Submission status: Runtime Error

Solution code:
def gcd(m, n):
    x = max(m, n)
    y = min(m, n)
    if x % y == 0:
        return y
    else:
        while x % y != 0:
            z = x % y
            x = y
            y = z
        else:
            return z


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


n = int(input())
# つまり全t[i]で割り切れる値を出せということ
# 最小公倍数を出せばよい
sum = int(input())
for i in range(1, n):
    t = int(input())
    # print("sum:{} t:{} lcm:{}".format(sum, t, lcm(sum, t)))
    sum = lcm(sum, t)
print(sum)
"""
# 入力 : 自然数     ex) 12
# 出力 : 約数リスト ex) [2, 2, 3]
def factorization(n):
    R = int(n)
    s = 0
    L = []
    div = 2
    first = True
    while s == 0:
        for i in range(div, R + 1):
            if n % i == 0:
                n = n / i
                if i == div and not first:
                    alreadyExist = True
                else:
                    alreadyExist = False
                first = False
                div = i
                if n == 1:
                    s = 1
                if alreadyExist:
                    L[-1][1] += 1
                else:
                    L.append([i, 1])
                break
    return L


n = int(input())
t = [0 for i in range(n)]
fact = []
for i in range(n):
    # print(i)
    t[i] = int(input())
    if i == 0:
        fact = factorization(t[i])
    else:
        tmpFact = factorization(t[i])
        for _tmpFact in tmpFact:
            for _fact in fact:
                if _fact[0] == _tmpFact[0]:
                    _fact[1] = max(_fact[1], _tmpFact[1])
                    break
                elif _fact[0] == fact[-1][0]:
                    fact.append(_tmpFact)
# つまり全t[i]で割り切れる値を出せということ
# 最小公倍数を出せばよい
sum = 1
for _fact in fact:
    sum *= _fact[0]**_fact[1]
print(sum)
"""

Submission status: Runtime Error

Solution code:
import math
from functools import reduce

n = int(input())
d = []
for i in range(n):
    d.append(input())
# [d1, d2, d3, ..., dN]
t = [int(m) for m in d]

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))
# 54

#print(lcm(27, 9, 3))
# 27

#print(lcm(*[27, 9, 3]))
# 27

print(lcm_list(t))

Submission status: Runtime Error

Solution code:
import math

n = int(input())

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

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

Submission status: Runtime Error

Solution code:
# 最大公約数
def gcd(m, n):
    while(n != 0):
        temp = n
        n = m % n
        m = temp
    return m


N = int(input())
T = [int(input()) for _ in range(N)]
ans = 0
for i in range(len(T)):
    if ans == 0:
        ans = T[i]
    else:
        ans = int(ans / gcd(ans, T[i])) * T[i]
print(ans)

Submission status: Runtime Error

Solution code:
# 最大公約数
def gcd(m, n):
    while(n != 0):
        temp = n
        n = m % n
        m = temp
    return m


N = int(input())
T = [int(input()) for _ in range(N)]
ans = 0
for i in range(len(T)):
    if ans == 0:
        ans = T[i]
    else:
        ans = int((ans * T[i]) / gcd(ans, T[i]))
print(ans)

Submission status: Runtime Error

Solution code:
# 最大公約数
def gcd(m, n):
    temp = 0
    while(m % n != 0):
        temp = n
        n = m % n
        m = temp
    return n


N = int(input())
T = [int(input()) for _ in range(N)]
ans = 0
for i in range(len(T)):
    if ans == 0:
        ans = T[i]
    else:
        ans = int((ans * T[i]) / gcd(ans, T[i]))
print(ans)

Submission status: Runtime Error

Solution code:
def gcd(a,b):
  if a<b:
    a,b=b,a
  while b>0:
    a,b=b,a%b
  return int(a)
def lcm(a,b):
  return int(a*b/gcd(a,b))
N=int(input())
T=1
for i in range(N):
  ti=int(input())
  T=lcm(T,ti)
print(T)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def gcd(a,b):
  while a>=1 and b>=1:
    a,b=b,a%b
  return int(a)
def lcm(a,b):
  return int(a*b/gcd(a,b))
N=int(input())
List_T=[int(input()) for i in range(N)]
T=1
n=1
for i in List_T:
  T=lcm(T,i)
print(T)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def gcd(x, y):
	if x < y:
		x, y = y, x
	if y == 0:
		return x
	z = x % y
	return gcd(y, z) 
	
N=int(input())
prenum = 1
for i in range(N):
	T = int(input())
	lcm = prenum / gcd(prenum, T) * T
	prenum = lcm
print(str(lcm))

Submission status: Runtime Error

Solution code:
def gcd(x, y):
	if x < y:
		x, y = y, x
	if y == 0:
		return x
	z = x % y
	return gcd(y, z) 
	
N=int(input())
prenum = 1
for i in range(N):
	T = int(input())
	lcm = (prenum / gcd(prenum, T)) * T
	prenum = lcm
print(int(lcm))

Submission status: Runtime Error

Solution code:
def gcd(x, y):
	if x < y:
		x, y = y, x
	if y == 0:
		return x
	z = x % y
	return gcd(y, z) 
	
N=int(input())
prenum = 1
for i in range(N):
	T = int(input())
	lcm = (prenum / gcd(T, prenum)) * T
	prenum = lcm
print(int(lcm))

Submission status: Runtime Error

Solution code:
def gcd(x, y):
	if x < y:
		x, y = y, x
	if y == 0:
		return x
	z = x % y
	return gcd(y, z) 		
N=int(input())
prenum = 1
for i in range(N):
	T = int(input())
	lcm = (prenum*T) / gcd(T, prenum)
	prenum = lcm
print(int(lcm))

Submission status: Runtime Error

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

T.sort()


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

    return a


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


ans = T[0]
for t in T[1:]:
    ans = lcm(ans, t)
    # print(ans)

print(ans)

Submission status: Runtime Error

Solution code:
import math
from functools import reduce

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

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

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)

N = int(input())
T = [0] * N
syuki = 0
for i in range(N):
    T[i] = int(input())
syuki = lcm(*T)
if max(T) > syuki:
    print(max(T) + syuki)
else:
    print(syuki)

Submission status: Runtime Error

Solution code:
import math

from functools import reduce

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

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

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)

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

Submission status: Runtime Error

Solution code:
N=int(input())
T=int(input())
gcd=100000000000000000000000
for i in range(N-1):
    T1=int(input())
    A=max(T,T1)
    B=min(T,T1)
    for j in range(1000000000000):
        
        if A%B==0:
            gcd=B
            
            break
        else:
            C=A%B
            if C>B:
                A=C
            else:
                B=C
print(T1*T/gcd)

Submission status: Runtime Error

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

N = int(input())
ans = 1

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

print(ans)

Submission status: Runtime Error

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

N = int(input())
ans = 1
for i in range(0,N):
    t = int(input())
    if t == 1000000000000000000:
        ans = 1000000000000000000
        break
    ans = int((ans * t) / gcd(ans, t))
print(ans)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

def gcd(a,b) :
    a,b = min(a,b),max(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(len(T)-1) :
    if i == 0 :
        ans = lcm(T[i],T[i+1])
    else :
        p = lcm(T[i],T[i+1])
        if p > ans :
            ans = p
print(ans)

Submission status: Runtime Error

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

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(len(P)-1) :
    if i == 0 :
        ans = lcm(P[i],P[i+1])
    else :
        p = lcm(P[i],P[i+1])
        if p > ans :
            ans = p
print(ans)

Submission status: Runtime Error

Solution code:
def euclid(A,B):

    big = max(A,B)
    small = min(A,B)

    r = big % small
    while r != 0:
        big = small
        small = r
        r = big % small
    
    return small


def LCM(A,B):
    return int(A*B/euclid(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:
from math import gcd
N = int(input())
a = int(input())
for i in range(N-1):
    b = int(input())
    c = a * b / gcd(a, b)
    a = b
    b = c
print(int(c))

Submission status: Runtime Error

Solution code:
from collections import deque
N = 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)


array = deque()
for _ in range(N):
    array.append(int(input()))

if len(array) == 1:
    print(array[0])

while len(array) > 1:
    a = array.pop()
    b = array.pop()
    array.append(lcm(a, b))

print(int(array[0]))

Submission status: Runtime Error

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


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

for i in range(len(a)-1):
    gcd(a[i],a[i+1])
    lcm=(a[i]*a[i+1])//gcd(a[i],a[i+1])

print(lcm)

Submission status: Runtime Error

Solution code:
from functools import lru_cache
from collections import deque
N = 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)


array = deque()
for _ in range(N):
    array.append(int(input()))

#@lru_cache(maxsize = None)
#def multi_lcm():

while len(array) > 1:
    a = array.pop()
    b = array.pop()
    array.append(lcm(a, b))

print(int(array[0]))

Submission status: Runtime Error

Solution code:

import sys
def 解():
    iN = int(sys.stdin.readline())
    aT = [int(_) for _ in sys.stdin.readlines()]

    #公倍数を求めるだけ

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

    lcm = aT[0] * aT[1] // fgcd(aT[0],aT[1])
    for a in aT[2:]:
        lcm = lcm * a // fgcd(lcm,a)
    print(lcm)
解()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
input()
t = list(map(int,input().split()))
lc = 1
for i in t:
    lc = lc * t // math.gcd(lc,t)
print(lc)

Submission status: Runtime Error

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

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

if N == 1:
    print(T[0])
else:
    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:
N = int(input())
L = [ int(input()) for i in range(N)]
L.sort()

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

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

x = L[0]
for i in range(len(L)-1):
    y = lcm(x, L[i+1])
    x = y
    
print(int(x))

Submission status: Runtime Error

Solution code:
N = int(input())
L = [ 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 a * b / gcd(a, b)

x = L[0]
for i in range(len(L)-1):
    y = lcm(x, L[i+1])
    x = y
    
print(int(x))

Submission status: Runtime Error

Solution code:
from math import gcd

n = int(input())

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

print(ans)

Submission status: Runtime Error

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

N = int(input())
A = 1

for _ in range(N):
    B = int(input())
    ans = int(A*B/gcd(A,B))
    A = ans
print(ans)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import math
n=int(input())
l = []
for i in range(0,n):
  l.append(int(input()))
  

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

res=l[0]
for i in range(1,n):
  res=lcm(res,l[i])
print(res)

Submission status: Runtime Error

Solution code:
#ABC 070: C [beta]
from fractions import gcd

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

a = clocks[0]
for i in range(1, N):
  a = gcd(a, clocks[i])
  b = b * clocks[i] / a

print(b)

Submission status: Runtime Error

Solution code:
#ABC 070: C [beta]
from fractions import gcd

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

a = clocks[0]
for i in range(1, N):
  a = gcd(a, clocks[i])
  b = a * clocks[i] / a

print(b)

Submission status: Runtime Error

Solution code:
#ABC 070: C [beta]
from fraction import gcd

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

a = clocks[0]
for i in range(1, N):
  a = gcd(a, clocks[i])
  b = a * clocks[i] / a

print(b)

Submission status: Runtime Error

Solution code:
import fraction

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

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

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

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 = []
for i in range(0, N):
    T.append(input())

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

print(str(ans))

Submission status: Runtime Error

Solution code:
n = int(input())
T=[int(input()) for i in range(n)]
T = sorted(T,reverse=True)

for i in range(2,100):
  if T[0] % T[1] !=0:
    if sum(map(lambda x:x/2, T)) !=0:
      T[0] = T[0]*i
  else:
    print(T[0])
    exit()

Submission status: Runtime Error

Solution code:
n = int(input())
T=[int(input()) for i in range(n)]
T = sorted(T,reverse=True)

for i in range(2,100):
  if T[0] % T[1] !=0:
    if sum(map(lambda x:T/2, T)) !=0:
      T[0] = T[0]*i
  else:
    print(T[0])
    exit()

Submission status: Runtime Error

Solution code:
n = int(input())
T=[int(input()) for i in range(n)]
T = sorted(T,reverse=True)

for i in range(2,100):
  if T[0] % T[1] !=0:
    T[0] = T[0]*i
  else:
    print(T[0])
    exit()

Submission status: Runtime Error

Solution code:
# coding: utf-8

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

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

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

print("{}".format(int(ans)))

Submission status: Runtime Error

Solution code:
# coding: utf-8

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

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

print("{}".format(int(ans)))

Submission status: Runtime Error

Solution code:
# coding: utf-8

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

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

print("{}".format(int(ans)))

Submission status: Runtime Error

Solution code:
# coding: utf-8

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

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

print("{}".format(int(ans)))

Submission status: Runtime Error

Solution code:
# coding: utf-8

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

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

print("{}".format(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 = []
for i in range(0, n):
    t.append(int(input()))
ans = 1
for i in range(0, n):
    ans = ans * t[i] / gcd(ans, t[i])

print(ans)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(100000)

N = int(input())
T = []
for i 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 int(a*b//gcd(a,b))

def lcm_li(li):
    if len(li) == 2:
        return lcm(li[0], li[1])
    else:
        x = lcm(li[0], li[1])
        x = [x] + li[2:]
        return lcm_li(x)

print(lcm_li(T))

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(100000)

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

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

lcm = 1
for i in T:
    lcm = int(lcm * i / gcd(lcm, i))

print(lcm)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(100000)

N = int(input())
T = []
for i 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 int(a*b/gcd(a,b))

def lcm_li(li):
    if len(li) == 2:
        return lcm(li[0], li[1])
    else:
        x = lcm(li[0], li[1])
        x = [x] + li[2:]
        return lcm_li(x)

print(lcm_li(T))

Submission status: Runtime Error

Solution code:
N = int(input())
T = []
for i 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 int(a*b/gcd(a,b))

def lcm_li(li):
    if len(li) == 2:
        return lcm(li[0], li[1])
    else:
        x = lcm(li[0], li[1])
        x = [x] + li[2:]
        return lcm_li(x)

print(lcm_li(T))

Submission status: Runtime Error

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

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

def lcm_li(li):
    if len(li) == 2:
        return lcm(li[0], li[1])
    else:
        x = lcm(li[0], li[1])
        x = [x] + li[2:]
        return lcm_li(x)

print(lcm_li(T))

Submission status: Runtime Error

Solution code:
import math

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

LCM = 1
for i in range(N):
    lcm = (T[i] * LCM) // (math.gcd(T[i], LCM))
    LCM = lcm

print(LCM)

Submission status: Runtime Error

Solution code:
import fractions

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

LCM = []
for i in range(N-1):
    lcm = T[i] * T[i+1] // fractions.gcd(T[i], T[i+1])
    LCM.append(lcm)

print(LCM[-1])

Submission status: Runtime Error

Solution code:
import math

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

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

print(LCM[-1])

Submission status: Runtime Error

Solution code:
import math
from sys import stdin
il = lambda func=int: list(map(func, stdin.readline().rstrip().split()))
ils = lambda n, s="int(input())": [eval(s) for _ in range(n)]

n = int(input())
t = ils(n)
ans = t[0]
for i in t[1:]:
    ans = ans * i // math.gcd(ans, i)
print(ans)

Submission status: Runtime Error

Solution code:
import math

n = int(input())
currentB = 1
index=0
while index < n:
    t = int(input())
    newB = int(t*currentB / math.gcd(t, currentB))
    currentB = newB
    index+=1

print(currentB)

Submission status: Runtime Error

Solution code:
import math

n = int(input())
currentB = 1
index=0
while index < n:
    t = int(input())
    newB = t*currentB // int(math.gcd(t, currentB))
    currentB = newB
    index+=1

print(currentB)

Submission status: Runtime Error

Solution code:
import numpy as np
import math
from functools import reduce

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

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

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


N = int(input())
T = np.array(sorted([int(input()) for _ in range(N)]))
print(lcm(*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())
numbers = []
for i in range(N):
    numbers.append(int(input()))

print(lcm_list(numbers))

Submission status: Runtime Error

Solution code:
#ABC070C
import math
from functools import reduce
N=int(input())
T=[int(input()) for i in range(N)]
#def lcm_base(x, y):
#    interium=x//math.gcd(x, y)
#    return (interium*y)
#print(reduce(lcm_base, T))
ans=1
def grcode(x, y):
    if y==0:
        return (x)
    else:
        return grcode(y, x%y)
#for i in range(N-1):
#    T[i]=T[i]//grcode(T[i],T[i+1])
#    T[i+1]=T[i]*T[i+1]
#print(T[N-1])
for i in range(N-1):
    T[i]=T[i]//math.gcd(T[i],T[i+1])
    T[i+1]=T[i]*T[i+1]
print(T[N-1])

Submission status: Runtime Error

Solution code:
#ABC070C
import math
from functools import reduce
N=int(input())
T=[int(input()) for i in range(N)]
#def lcm_base(x, y):
#    interium=x//math.gcd(x, y)
#    return (interium*y)
#print(reduce(lcm_base, T))
ans=1
for i in range(N-1):
    T[i]=T[i]//math.gcd(T[i], T[i+1])
for i in range(N):
    ans=ans*T[i]
print(ans)

Submission status: Runtime Error

Solution code:
#ABC070C
import math
from functools import reduce
N=int(input())
T=[int(input()) for i in range(N)]
#def lcm_base(x, y):
#    interium=x//math.gcd(x, y)
#    return (interium*y)
#print(reduce(lcm_base, T))
ans=1
for i in range(N-1):
    T[i]=T[i]/math.gcd(T[i], T[i+1])
for i in range(N):
    ans=ans*T[i]
print(int(ans))

Submission status: Runtime Error

Solution code:
#ABC070C
import math
from functools import reduce
N=int(input())
T=[int(input()) for i in range(N)]
def lcm_base(x, y):
    interium=x/math.gcd(x, y)
    return (interium*y)
print(reduce(lcm_base, T))

Submission status: Runtime Error

Solution code:
#ABC070C
import math
from functools import reduce
N=int(input())
T=[int(input()) for i in range(N)]
def lcm_base(x, y):
    interium=x//math.gcd(x, y)
    return (interium*y)
print(reduce(lcm_base, T))

Submission status: Runtime Error

Solution code:
#ABC070C
import math
from functools import reduce
N=int(input())
T=[int(input()) for i in range(N)]
def lcm_base(x, y):
    return (x//math.gcd(x, y)*y)
print(reduce(lcm_base, T))

Submission status: Runtime Error

Solution code:
#ABC070C
import math
from functools import reduce
#N=int(input())
T=[int(input()) for i in range(N)]
def lcm_base(x, y):
    return (x//math.gcd(x, y)*y)
print(reduce(lcm_base, T))

Submission status: Runtime Error

Solution code:
#ABC070C
import math
from functools import reduce
N=int(input())
T=[int(input()) for i in range(N)]
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
print(reduce(lcm_base, T))

Submission status: Runtime Error

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

print(a)