TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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?

Submission attempts (in order):
N = int(input())
Ts = list(set([int(input()) for _ in range(N)]))

def get_divider(n):
    divider = set()
    for i in range(1, n):
        if i * i > n:
            break

        if n % i == 0:
            divider.add(i)
            if i != int(n / i):
                divider.add(int(n / i))
    return divider


divider_set = set()
for T in Ts:
    divider_set = divider_set.union(get_divider(T))
divider_set.discard(1)
print(str(min(divider_set)))


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


Verdicts: Wrong Answer

Accepted
Problem: 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?

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


import numpy as np
T = np.array(T)


ans = 1

flg = True
while(flg):
    for i in range(2, int(np.sqrt(max(T))) + 1):
        if sum(T % i) == 0:
            T = T // i
            # print(T)
            ans = ans * i
            break
        flg = False

for t in np.unique(T):
    ans = ans * t


print(ans)


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


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

print(ans)


Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
import numpy as np

N = int(input())

arr_T = np.empty(N)
for i in range(N):
    arr_T[i] = int(input())



max_T = np.max(arr_T)
lcm = max_T

while True:
    
    bools = lcm % arr_T == 0
    if bools.all():
        break
    else:
        lcm += max_T


print(lcm)

import numpy as np


def get_gcd(a, b):
    a, b = max(a, b), min(a, b)
    c = a % b
    if c == 0:
        return b
    else:
        return get_gcd(b, c)

# --------------------------------------------


N = int(input())

arr_T = np.empty(N, dtype = int)
for i in range(N):
    arr_T[i] = int(input())

arr_sort_T = np.sort(arr_T)[::-1]



max_T = np.max(arr_T)
m = max_T
if N != 1:
    
    for n in arr_sort_T[1:]:
        gcd = get_gcd(m, n)
        m = (m // gcd) * n


print(m)

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde	s=input()	s='abcde'
# abcde	s=list(input())	s=['a', 'b', 'c', 'd', 'e']

# 1 2	| x,y = map(int,input().split())   |	x=1,y=2




# INPUT
# 3
# hoge
# foo
# bar
# ANSWER
# n=int(input())



from collections import defaultdict, Counter
import math
from bisect import bisect_left, bisect_right
import numpy as np


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


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


def lcmlist(numbers):
    a = numbers[0]
    for i in range(1, len(numbers)):
        a = lcm(a, numbers[i])
    return a

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

print(lcmlist(t))


# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde	s=input()	s='abcde'
# abcde	s=list(input())	s=['a', 'b', 'c', 'd', 'e']

# 1 2	| x,y = map(int,input().split())   |	x=1,y=2




# INPUT
# 3
# hoge
# foo
# bar
# ANSWER
# n=int(input())



from collections import defaultdict, Counter
import math
from bisect import bisect_left, bisect_right
import numpy as np


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


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


def lcmlist(numbers):
    a = numbers[0]
    for i in range(1, len(numbers)):
        a = lcm(a, numbers[i])
    return int(a)

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

print(lcmlist(t))


Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
sys.setrecursionlimit(100000)
def lcm(x,y):
    return (x*y)//gcd(x,y)

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

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

import sys
import os
sys.setrecursionlimit(1000000000000000)

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

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

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


import sys
import os
sys.setrecursionlimit(10000000000000)

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

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

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


import sys
import os
sys.setrecursionlimit(100000000)

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

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

N = int(input())
T = [int(input()) for _ in range(N)]
if N == 1:
    print(T[0])
    sys.exit()

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


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
import math
n = int(input())
s = int(input())
def gcd_core(a, b):
    if b == 0:
        return a
    else:
        return gcd_core(b, a % b)
for i in range(1,n):
    t = int(input())
    s = (s*t)//math.gcd_core(s,t)

print(s)

n = int(input())
s = int(input())
def gcd_core(a, b):
    if b == 0:
        return a
    else:
        return gcd_core(b, a % b)
for i in range(1,n):
    t = int(input())
    s = (s*t)//gcd_core(s,t)

print(s)

Verdicts: Runtime Error

Accepted
Problem: 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?

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

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

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

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

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

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

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

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

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
def gcd (num1,num2):
    tmp = max(num1,num2) % min(num1,num2)
    if tmp == 0:
        return min(num1,num2)
    return gcd(min(num1,num2),tmp)


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

for i in range(len(t)-1):
    stock.append(t[i] * t[i+1] / gcd(stock[i],t[i]))

print(stock[-1])

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

n = int(input())
t = [int(x) for x in input()]
time = 1

for i in t:
    time = time * t // gcd(time,i)

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

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

time = 1

for i in t:
    time = time * i / gcd(time,i)

print(time)

def gcd (num1,num2):
    tmp = max(num1,num2) % min(num1,num2)
    if tmp == 0:
        return min(num1,num2)
    return gcd(min(num1,num2),tmp)

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

for i in range(len(t)-1):
    stock.append(t[i] * t[i+1] / gcd(stock[i],t[i]))

print(stock[-1])

n = int(input())
ans = int(input())
 
def gcd(a,b):
    while b:
        a,b = b,a%b
    return a
 
def lcm(x,y):
    return (x*y//gcd(x,y))
 
for i in range(N-1):
    t = int(input())
    ans = lcm(ans,t)
print(ans)

n = int(input())
ans = int(input())
 
def gcd(a,b):
    while b:
        a,b = b,a%b
    return a
 
def lcm(x,y):
    return (x*y//gcd(x,y))
 
for i in range(n-1):
    t = int(input())
    ans = lcm(ans,t)
print(ans)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
cl = [int(input()) for i in range(int(input()))]
ans = 1

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

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

for i in cl:
    ans = lcm(ans,i)
    print(ans)

print(ans)


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

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

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

for i in cl:
    ans = lcm(ans,i)

print(ans)


Verdicts: Wrong Answer

Accepted
Problem: 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?

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

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

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
n = int(input())
lc = 1
for i in range(n):
    t = int(input())
    lc = lc * t // gcd(lc,t)
print(lc)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
n = int(input())

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

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

def lcm1(a,b):
  return a*b//gcd1(a,b)
num = 1
for i in range(2,len(li)):
    num = lcm1(num,li[i])
print(num)
    

n = int(input())

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

def lcm1(a,b):
  return a*b//gcd1(a,b)
num = 1
for i in range(n):
    num = lcm1(num,int(input()))
print(num)
    

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
import fractions
N = int(input())
ans = 1

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

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

print(ans)


N = int(input())
ans = int(input())

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

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

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

print(ans)


Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
N=int(input())
T=[int(input()) for _ in range(N)]
T=list(set(T))
print(T)

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

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

N=int(input())
T=[int(input()) for _ in range(N)]
T=list(set(T))
N=len(T)
#print(T)

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

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

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
N = int(input())
T = []
for _ in range(N):
    T.append(int(input()))
for x in range(1,10**8):
    for y in T:
        z = 0
        z += x % y
    if z == 0:
        print(x)
        break
    


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)
if N == 1:
    print(T[0])
else:
    result = lcm(T[0],T[1])

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

    print(result)
    


Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
import sys
import math
if N == 1:
	print(T[0])
	sys.exit()
def GCD(a,b):
	if b == 0:
		return a
	return GCD(b,a%b)

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

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

for i in range(1,N):
	if i == 1:
		temp = SKS(T[0], T[1])
		continue

	temp = SKS(temp, T[i])

print(temp)

import sys
import math

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

N = int(input())
T = [int(input()) for _ in range(N)]
if N == 1:
	print(T[0])
	sys.exit()
def SKS(a,b):
	return (a*b)//GCD(a,b)

for i in range(1,N):
	if i == 1:
		temp = SKS(T[0], T[1])
		continue

	temp = SKS(temp, T[i])

print(temp)

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
import fractions


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


def list_lcm(number_list):
    lcm_number = 1
    for j in range(len(number_list)):
        lcm_number = lcm(lcm_number, number_list[j])

    return lcm_number


if __name__ == '__main__':
    number_count = int(input())
    numbers = []
    for i in range(number_count):
        numbers.append(int(input()))
    print(int(list_lcm(numbers)))


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


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


def list_lcm(number_list):
    lcm_number = 1
    for j in range(len(number_list)):
        lcm_number = lcm(lcm_number, number_list[j])

    return lcm_number


if __name__ == '__main__':
    number_count = int(input())
    numbers = []
    for i in range(number_count):
        numbers.append(int(input()))
    print(int(list_lcm(numbers)))


Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
N = int( input() )
T = [ int( input() ) for _ in range(N) ]





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


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


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

import functools

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





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


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


ans = functools.reduce( LCM, T ) 
print( ans )

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
import sys

sys.setrecursionlimit = 10000000

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

import sys

sys.setrecursionlimit = 10000000

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

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
def gcd(a, b):
  if b == 0:
    return a
  return gcd(b, a % b)   

n=int(input())
p=1
for i in range(n):
  m=int(input())
  p=p*m/gcd(p,m)
print(p)

def gcd(a, b):
  if b == 0:
    return a
  return gcd(b, a % b)   
 
n=int(input())
p=1
for i in range(n):
  m=int(input())
  p=p*m//gcd(p,m)
print(int(p))

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
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()


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

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

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

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

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


k=A[0]
for i in A[1:]:
  k=lcm(k,i)
print(k)


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
import urllib.request
from bs4 import BeautifulSoup
import re
import sys
import os
import time
import subprocess
import datetime


def gcd(a, b):
    if a < b:
        c = a
        a = b
        b = c

    r = a % b

    while r > 0:
        a = b
        b = r
        r = a % b

    return b

    
    #   if (a < b)
    #     swap(a, b);
    
    #
    #   while (r) {
    #     a = b;
    #     b = r;
    #     r = a % b;
    #   }
    #
    #   return b;
    # }


N = int(input())
a = []
for i in range(N):
    a.append(int(input()))
# a = list(map(int, input().split()))

ans = a[0]

for i in range(N):
    if i == 0:
        continue

    g = gcd(ans, a[i])
    ans = ans * a[i] // g

print(ans)



def gcd(a, b):
    if a < b:
        c = a
        a = b
        b = c

    r = a % b

    while r > 0:
        a = b
        b = r
        r = a % b

    return b

    
    #   if (a < b)
    #     swap(a, b);
    
    #
    #   while (r) {
    #     a = b;
    #     b = r;
    #     r = a % b;
    #   }
    #
    #   return b;
    # }


N = int(input())
a = []
for i in range(N):
    a.append(int(input()))
# a = list(map(int, input().split()))

ans = a[0]

for i in range(N):
    if i == 0:
        continue

    g = gcd(ans, a[i])
    ans = ans * a[i] // g

print(ans)


Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)

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

import sys
input = sys.stdin.readline
N = int(input())
T = [int(input()) for _ in range(N)]
if N == 1:
    ans = T[0]
else:
    ans = lcm(T[0], T[1])
    for i in range(2, N):
    ans = lcm(ans, T[i])
print(ans)

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

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

import sys
input = sys.stdin.readline
N = int(input())
if N == 1:
    print(input())
else:
    T = [int(input()) for _ in range(N)]
    ans = lcm(T[0], T[1])
    for i in range(2, N):
        ans = lcm(ans, T[i])
    print(ans)


Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
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])

def gcd(a, b):
    while b > 0:
        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)]
for i in range(n-1):
    t[i+1] = lcm(t[i],t[i+1])
print(t[n-1])

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
import math
from functools import reduce

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


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

print(lcm_list(L))


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())
L = [int(input()) for _ in range(N)]

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


Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
import functools
N = int(input())
T = []
for i in range(N):
  T.append(int(input()))

def gcd(a, b):
  if a < b:
    a, b = b, a
  if b == 0:
    return a
  return gcd(b, b % a)
 
def lcm(A, B):
  return (A // gcd(A, B)) * B
 
print(functools.reduce(lcm, T))

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

def gcd(a, b):
  if a < b:
    a, b = b, a
  if b == 0:
    return a
  return gcd(b, b % a)
 
def lcm(A, B):
  return A * B // gcd(A, B)
 
print(functools.reduce(lcm, sorted(T, reverse=True)))

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

def gcd(a, b):
  if a < b:
    a, b = b, a
  if b == 0:
    return a
  return gcd(b, b % a)
 
def lcm(A, B):
  return (A // gcd(A, B)) * B
 
print(functools.reduce(lcm, sorted(T, reverse=True)))

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

def gcd(a, b):
  if a < b:
    a, b = b, a
  if b == 0:
    return a
  return gcd(b, b % a)
 
def lcm(A, B):
  return A * B // gcd(A, B)
 
print(functools.reduce(lcm, T))

import functools
N = int(input())
T = []
for i in range(N):
  T.append(int(input()))
 
def gcd(a, b):
  if a < b:
    a, b = b, a
  if b == 0:
    return a
  return gcd(b, a % b)
 
def lcm(A, B):
  return (A // gcd(A, B)) * B
 
print(functools.reduce(lcm, T))

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
N = int(input())

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

g = 1
for x in (int(input()) for _ in range(N)):
  g = g * x / gcd(g, x)
print(g)


N = int(input())

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

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


N = int(input())

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

g = 0
for x in (map(int, input()) for _ in range(N)):
  g = gcd(g, x)
print(g)


N = int(input())

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

g = 1
for x in (int(input()) for _ in range(N)):
  g = g * x // gcd(g, x)
print(g)


Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
def gcd(a, b):
    while a != b:
        if (a != 1 and b != 1):
            if a < b:
                b = b % a
            elif a > b:
                a = a % b
            else:
                break
    if (a == 1 or b == 1):
        return 1
    else:
        return a

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


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


n=int(input())
ans = 1
for i in range(n):
    inp = int(input())
    tmp = ans * inp
    tmp2 =ans
    while (ans % inp != 0):
        if (inp % ans == 0):
            ans = inp
            break
        ans += tmp2
        print(ans)
        print(ans%inp)
print(ans)

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

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


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


Verdicts: Time Limit Exceeded

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
import math as m
from functools import reduce

n=int(input())
l=set([])
def gcd(a,b):
    a1=a
    b1=b
    if b%a==0 :
        return b
    if a%b==0:
        return a
    while a != 0:
        c = a
        a = b % a
        b = c
    return a1*b1/b

for i in range(n):
    l.add(int(input()))
print(reduce(gcd,l))










import math as m
from functools import reduce
n,T= int(input()),[]
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
for i in range(n):
    T.append(int(input()))
tmp = max(T)
for i in range(n):
    if tmp % T[i] != 0:
        tmp = T[i]//gcd(tmp, T[i])*tmp

print(tmp)



Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
def gcd(a,b):
    while b:
        a, b = b, a % b
    return max(a,b)

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


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

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

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

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

Verdicts: Wrong Answer

Accepted
Problem: 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?

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





@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)))





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)]
ans = 1

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

print(ans)


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
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))

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

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
 = 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)

N = int(input())
T = set([int(input()) for i in range(N)])
ans = 0
t = max(T)
kensa = [t]
while max(kensa) <= 10 **18:
    i = 2
    kensa.append(i*t)
    i += 1
    
for i in kensa:
    for j in T:
        if i%j != 0:
            break
    else:
        ans = i
        continue
    break
print(ans)

import math

num = 1
for i in range(int(input())):
    a = int(input())
    cnt = math.gcd(a, num)
    num = (a * num) // cnt
print(num)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
N = int(input())
a = [int(input()) for x in range(N)]
print(a)

ans = max(a)
mx = max(a)
iteration = 1 
while (ans < 10^18):
    flag = True 
    for item in a:
        if not (ans%item == 0):
           flag = False
    if flag:
        print(ans)
        break
    else:
        iteration = iteration + 1
        ans = iteration * mx

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


Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
import fractions

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


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

time = 0
for i in range(0, n):
    if i == 0:
        time = t_sorted[0]
    else:
        time = lcm(int(time), t_sorted[i])

print(int(time))

def gcd(n, m):
    if min(n, m) == 0:
        return max(n,m)
    else:
        return gcd(min(n,m), max(n,m) % min(n,m))

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


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

time = 0
for i in range(0, n):
    if i == 0:
        time = t_sorted[0]
    else:
        time = lcm(time, t_sorted[i])

print(int(time))

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
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])

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]))

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


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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
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 = lcm(ans,i)

print(ans)

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

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

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

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

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
def GCD(x: int, y: int):
    if x < y:
        x, y = y, x

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


def LCM(x: int, y: int):
    return x * y // GCD(x, y)


N = int(input())
Tlist = [int(input()) for i in range(N)]
ans = 1
for num in Tlist[1:]:
    ans = LCM(ans, num)
print(ans)


def GCD(x: int, y: int):
    if x < y:
        x, y = y, x

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


def LCM(x: int, y: int):
    return x * y // GCD(x, y)


N = int(input())
Tlist = [int(input()) for i in range(N)]
ans = 1
for num in Tlist:
    ans = LCM(ans, num)
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
n = int(input())
t = list(int(input()) for i in range(n))
mxt = max(t)
ls = []
ans = 0
j = 0
mod_flag = False

for i in range(n):
    if not mxt % t[i] == 0:
        mod_flag = True
        ls.append(t[j])
        j+=1
    
if mod_flag:
    ans = mxt

if ans == 0:
    ans = 1
    for i in range(len(ls)):
        ans *= ls[i]
    ans *= mxt
    
print(ans)


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 = list(int(input()) for i in range(n))
mxt = max(t)
ls = []
ans = 0
j = 0
mod_flag = False

for i in range(n):
    if not mxt == t[i] and not mxt % t[i] == 0:
        mod_flag = True
        ls.append(t[i])
        j+=1
    
if not mod_flag:
    ans = mxt

if ans == 0:
    ans += mxt
    for i in range(len(ls)):
        if not ans % ls[i] == 0:
            print(ans)
            ans = lcm(ans,ls[i])
    
print(ans)


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 = list(int(input()) for i in range(n))
mxt = max(t)
ls = []
ans = 0
j = 0
mod_flag = False

for i in range(n):
    if not mxt == t[i] and not mxt % t[i] == 0:
        mod_flag = True
        ls.append(t[i])
        j+=1
    
if not mod_flag:
    ans = mxt

if ans == 0:
    ans += mxt
    for i in range(len(ls)):
        if not ans % ls[i] == 0:
            ans = lcm(ans,ls[i])
    
print(ans)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
n = int(input())
lis = []
for i in range(n):
    lis.append(int(input()))
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
print(lcm(lis))

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


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

print(lcm(lis))

import numpy as np
n = int(input())
lis = []
for i in range(n):
    lis.append(int(input()))
print(np.lcm.reduce(lis))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
import fractions

def main():
    n = int(input())
    ans = 1
    for _ in range(n):
        t = int(input())
        ans = ans*t/fractions.gcd(ans,t)
    print(int(ans))


if __name__ == "__main__":
    main()


import fractions

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

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


if __name__ == "__main__":
    main()

import fractions

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

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


if __name__ == "__main__":
    main()

import fractions

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

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


if __name__ == "__main__":
    main()

import fractions

def main():
    n = int(input())
    ans = int(input())
    for _ in range(n-1):
        t = int(input())
        ans = ans*t/fractions.gcd(ans,t)
    print(int(ans))


if __name__ == "__main__":
    main()


import sys
input = sys.stdin.readline

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

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

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


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
# -*- coding: utf-8 -*-

import fraction
from functools import reduce

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


def lcm_base(x, y):
    return (x * y) // fraction.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

print(lcm_list(TN))

# -*- coding: utf-8 -*-

from functools import reduce

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


def gcd(a, b):
    while b > 0:
        a, b = b, a%b
    return a
def lcm_base(x, y):
    return (x * y) // gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

print(lcm_list(TN))

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
import fractions
n=int(input())
t=[int(input()) for i in range(n)]
t.sort()
for i in range(n-1):
    f1=fractions.gcd(t[i],t[i+1])
    f2=t[i]*t[i+1]//f1
print(f2)

import fractions
n=int(input())
t=[int(input()) for i in range(n)]
t.sort()
check=t[0]
for i in range(n-1):
    f1=fractions.gcd(t[i],t[i+1])
    f2=check*t[i+1]//f1
    check=f2
print(f2)

import fractions
n=int(input())
t=[int(input()) for i in range(n)]
t.sort()
check=t[0]
for i in range(n-1):
    f1=fractions.gcd(t[i],t[i+1])
    f2=t[i]*t[i+1]//f1
    check=f2
print(f2)

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

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

	
if n==1:
	print(t[0])
	exit()

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
n = int(input())
import functools
from functools import reduce

def gcd(numbers):
    return reduce(functools.gcd, numbers)

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

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


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


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

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

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


Verdicts: Runtime Error

Accepted