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: Wrong Answer

Solution code:
N=int(input())
T=[int(input()) for i in range(N)]
T.sort(reverse=True)
ans=T[0]
def nibu(ans,t):
    if ans%t==0:
        return ans
    Min=1
    big=min((10**18+ans-1)//ans,t)
    Max=big
    check=(1,2)
    now=big*check[0]//check[1]
    while True:
        if now*ans%t==0:
            if Min+1==now:
                return ans*now
            Max=min(now,Max)
            check=(check[0]*2-1,check[1]*2)
        elif now*ans%t!=0:
            if Max-1==now:
                return ans*Max
            Min=max(now,Min)
            check=(check[0]*2+1,check[1]*2)
        now=big*check[0]//check[1]
for i in range(1,N):
    t=T[i]
    ans=nibu(ans,t)
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=int(input())
for i in range(n-1):
    t=int(input())
    if t%ans==0:
        ans=t
    else:
        ans*=t
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=int(input())
for i in range(n-1):
    t=int(input())
    if ans%t!=0:
        if t%ans==0:
            ans=t
        else:
            ans*=t
print(ans)

Submission status: Wrong Answer

Solution code:
def gcd(a,b):
  r = a%b
  while(r!=0):
    a=b
    b=r
    r=a%b
  return b
def lcm(a,b):
    return (a*b)/gcd(a,b)
n = int(input())
ans = int(input())
for i in range(n-1):
  num = int(input())
  ans = lcm(max(ans,num),min(ans,num))
print(int(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

x = 1
M = max(cycles)
while 1:
    for num in cycles:
        if (M * x) % num != 0:
            x += 1
            continue
    else:
        print(M * x)
        quit()

Submission status: Wrong Answer

Solution code:
n=int(input())
arr_Ti = [int(input()) for _ in range(n)]
keep = [max(arr_Ti)]
def prod(arr):
  val=1
  for n in arr:
    val*=n
  return val
for num in arr_Ti[::-1]:
  if max(arr_Ti)%num!=0:
    keep.append(num)
print(prod(keep))

Submission status: Wrong Answer

Solution code:
import fractions
def lcm(a,b):
  return a*b/fractions.gcd(a,b)
n=int(input())
a=1
for i in range(n):
  a=lcm(a,int(input()))
if n==2 and a==6:
  exit()
print(int(a))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import fractions

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

l = T[0]

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

print(l)

Submission status: Wrong Answer

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

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

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

for i in range(n-1):
    t[i+1]=l(t[i+1], t[0])
print(t[n-1])

Submission status: Wrong Answer

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

result = t.pop(0)

for timer in t:
    if result % timer != 0:
        result *= timer
    else:
        result = max(result, timer)

print(result)

Submission status: Wrong Answer

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

result = t[0]

for timer in t:
    if result % timer != 0:
        result *= timer
        
print(result)

Submission status: Wrong Answer

Solution code:
from fractions import gcd
from functools import reduce

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

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

print(int(t))

Submission status: Wrong Answer

Solution code:
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
n=int(input())
ans=1
for _ in range(n):
    t=int(input())
    ans=ans*t/gcd(t,ans)
print("{:.0f}".format(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())
T = []
for i in range(N):
    T.append(int(input()))
T.sort()
ans = 1
for j in range(N):
    if T[j]%ans == 0:
        ans = T[j]
    else:
        ans*=T[j]
        
print(ans)

Submission status: Wrong Answer

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

m = max(T)
mm = m
for i in range(N):
    flg =False
    for j in range(N):
        if m % T[j] != 0:
            flg = True
            break
    if flg == True:
        m += mm
    else:
        print(m)
        exit()

Submission status: Wrong Answer

Solution code:

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

m = max(T)
for i in range(N):
    flg =False
    for j in range(N):
        if m % T[j] != 0:
            flg = True
            break
    if flg == True:
        m *= 2
    else:
        print(m)
        exit()

Submission status: Wrong Answer

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

m = max(T)
for i in range(N):
    flg =False
    for j in range(N):
        if m % T[i] != 0:
            flg = True
            break
    if flg == True:
        m *= 2
    else:
        print(m)
        exit()

Submission status: Wrong Answer

Solution code:
# ABC 070
import math
# gcdはエラーになる
def getInt(): return int(input())
def getIntFromRows(n): return [int(input()) for i in range(n)]
def gcd(x, y):
    m = max(x,y)
    n = min(x,y)
    while m%n != 0:
        w = m%n
        m = n
        n = w
    return n

N = getInt()
T = getIntFromRows(N)
a = T[0]
lcm = T[0]
for i in range(1, N):
    gc = gcd(a, T[i])
    lcm = a * T[i] // gc
    a = gc
print(lcm)

Submission status: Wrong Answer

Solution code:
N = int(input())
T = []

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

print(123)

Submission status: Wrong Answer

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

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

if(N == 1):
  print(*T)
else:
  result = []
  for i in range(N):
    try:
      s = (T[i] * T[i+1]) // gcd(T[i], T[i+1])
      result.append(s)
    except:
      break
  print(max(result))

Submission status: Wrong Answer

Solution code:
from fractions import gcd
from functools import reduce
N = int(input())
T = [int(input()) for i in range(N)]
g = reduce(gcd,T)
product = 1
for e in T:
    product *= e
ans = product // pow(g,len(T) - 1)
if ans > 10**18:
    ans = 10**18
print(ans)

Submission status: Wrong Answer

Solution code:
import fractions

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

Submission status: Wrong Answer

Solution code:
import fractions

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

A=L[0]
for j in range(1,N):
    if A%L[j]==0:
        pass
    else:
        A=A*L[j]/fractions.gcd(A,L[j])
print(int(A))

Submission status: Wrong Answer

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


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


n = int(input())
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)

Submission status: Wrong Answer

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


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


n = int(input())
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)

Submission status: Wrong Answer

Solution code:
n = int(input())
num_list = [int(input()) for _ in range(n)]
max_num = max(num_list)
min_num = min(num_list)
diff = max_num%min_num

while diff:
    max_num *= 2
    diff = max_num%min_num

print(max_num)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

# 要は最小公倍数っぽいものを求めろ
T.sort()
ans = T[0]
for t in T[1:]:
    # print(ans)
    if ans % t is not 0:
        ans = ans * t

print(ans)

Submission status: Wrong Answer

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

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 m * n//gcd(m, n)


while n > 1:
    i = 0
    next = []
    if n % 2 == 1:
        next.append(t[n-1])
        n -= 1
    while i < n:
        next.append(lcm(t[i], t[i + 1]))
        i += 2
    t = [] + next
    n = len(t)
    print(t)

print(t[0])

Submission status: Wrong Answer

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

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


while n > 1:
    i = 0
    next = []
    if n % 2 == 1:
        next.append(t[n-1])
        n -= 1
    while i < n:
        next.append(lcm(t[i], t[i + 1]))
        i += 2
    t = [] + next
    n = len(t)

print(t[0])

Submission status: Wrong Answer

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)
if len(T) == 1 :
    ans = T[0]
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: Wrong Answer

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)

if N!=1:
    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])
else:
    lcm=a[0]

print(lcm)

Submission status: Wrong Answer

Solution code:
N = 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 = gcd(T[0], T[1])
    for i in range(N):
        ans = gcd(ans, T[i])
    ans = (T[0]*T[N-1])//(ans)
    print(ans)

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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 * int(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: Wrong Answer

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 = B
print(ans)

Submission status: Wrong Answer

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

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

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

print(b)

Submission status: Wrong Answer

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 sum(map(lambda x:T[0]%x, T)) !=0:
    T[0] = T[0]*i
  else:
    print(T[0])
    exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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 = lcm * i / gcd(lcm, i)

print(lcm)

Submission status: Wrong Answer

Solution code:
import fractions

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

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

print(LCM)

Submission status: Wrong Answer

Solution code:
import fractions

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

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

print(LCM)

Submission status: Wrong Answer

Solution code:
import fractions

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

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

print(LCM)

Submission status: Wrong Answer

Solution code:
from fractions import gcd
l=1
for _ in[0]*int(input()):
    t=int(input())
    l=gcd(l,t)
print(l)

Submission status: Wrong Answer

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


n = int(input())
list_t = []
for i in range(n):
    list_t.append(int(input()))
g = list_t[0]
l = list_t[0]
for i in range(n):
    g = gcd(g,list_t[i])
    l = (l*list_t[i]) // g
print(l)

Submission status: Wrong Answer

Solution code:
#python3.4以前はfractionsにgcdがある。3.5以降はmath
#lcm（最小公倍数）はa*b/gcd(a,b)
import fractions
n=int(input()) 
t=[int(input()) for _ in range(n)]
if(n==1):
    print(t[0])
    exit()
tlcm=(t[0]*t[1])/(fractions.gcd(t[0],t[1]))

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

Submission status: Wrong Answer

Solution code:
import numpy as np

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

max_T = np.max(T)
Time_max  = 10**18 // max_T


for T_del in range(1,Time_max):
    Time = T_del * max_T

    ch = 0

    for t in T:
        if Time%t != 0:
            ch = 1
            break
    if ch == 0:
        print(Time)
        exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
le = [int(input()) for i in range(N)]
le.sort()#昇順
#３数以上の最小公倍数を求める問題
#a,b2数の最小公倍数とcの最小公倍数で求められる
#２数の最小公倍数はユークリッドの互除法を利用して再帰関数で求められる。

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


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

def multi_LCM(le):
    print(le)
    if len(le)==1:
        return 
    mxle=le[-1]
    del(le[-1])
    le[-1]=LCM(le[-1],mxle)
    multi_LCM(le)

if(len(le)==2):
    le[0]=LCM(le[0],le[1])
if(len(le)>=2):
    multi_LCM(le)

print(le[0])

Submission status: Wrong Answer

Solution code:
N = int(input())
T = [0 for i in range(N)]
for i in range(N):
    T[i] = int(input())
T.sort()
def lcm(s, t):
    u = s
    v = t
    while v != 0:
        r = u % v
        u = v
        v = r
    return(s * t/u)
now = T[0]
for i in range(1,N):
    now = lcm(now, T[i])


print(int(now))

Submission status: Wrong Answer

Solution code:
N = int(input())
T = [0 for i in range(N)]
for i in range(N):
    T[i] = int(input())
def lcm(s, t):
    u = s
    v = t
    while v != 0:
        r = u % v
        u = v
        v = r
    return(s * t/u)
now = T[0]
for i in range(1,N):
    now = lcm(now, T[i])


print(int(now))

Submission status: Wrong Answer

Solution code:
N = int(input())
t = [int(input()) for x in range(N)]

def lcm(a, b) :
    if max(a, b) % min(a, b) == 0 :
        return max(a, b)
    else :
        return a*b
    
cur_lcm = t[0]
for i in range(1, N) :
    cur_lcm = lcm(cur_lcm, t[i])
    
print(cur_lcm)

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=int(input())
for i in range(n-1):
    a=int(input())
    if max(a,ans)%min(a,ans)==0:
        ans=max(ans,a)
    else:
        ans=a*ans
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
t = sorted([int(input()) for x in range(N)])

max_at = t[N - 1]
t_new = []
for i in range(N - 1) :
    flg_push = True
    for j in range(i + 1, N - 1) :
        if t[j] % t[i] == 0 :
            flg_push = False
            break
    if flg_push == True :
        t_new.append(t[i])
        
# print("DBG : ", t_new)
for i in range(len(t_new)) :
    if max_at % t_new[i] != 0 :
        max_at *= t_new[i]
        
print(max_at)

Submission status: Wrong Answer

Solution code:
N = int(input())
t = sorted([int(input()) for x in range(N)])

max_at = t[N - 1]
t_new = []
for i in range(N - 1) :
    flg_push = False
    for j in range(i + 1, N - 1) :
        if t[j] % t[i] == 0 :
           flg_push = True
           break
    if flg_push == True :
        t_new.append(i)
        
for i in range(N - 1) :
    if max_at % t[i] != 0 :
        max_at *= t[i]
        
print(max_at)

Submission status: Wrong Answer

Solution code:
N = int(input())
t = sorted([int(input()) for x in range(N)])

max_at = t[N - 1]

for i in range(N - 1) :
    if max_at % t[i] != 0 :
        max_at *= t[i]
        
print(max_at)

Submission status: Wrong Answer

Solution code:
N = int(input())
t = [int(input()) for x in range(N)]

max_at = t[N - 1]

for i in range(N - 1) :
    if max_at % t[i] != 0 :
        max_at *= t[i]
        
print(max_at)

Submission status: Wrong Answer

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

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

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

print(b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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


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


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

print(int(x))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = []
import fractions
for i in range(N):
    a.append(int(input()))
def lcd(m,n):
  c = fractions.gcd(m,n)
  return m*n/c
def ans(li):
  if len(li)==1:
    return li[0]
  else:
    li[0]=lcd(li[0],li[1])
    del li[1]
    return ans(li)
print(int(ans(a)))

Submission status: Wrong Answer

Solution code:
import sys

stdin = sys.stdin

n = int(stdin.readline())
t = [0]*n
for i in range(n):
    t[i] = int(stdin.readline())

max = max(t)
ok = 0
while True:
    for i in t:
        if max % i == 0:
            ok += 1
        else:
            break
    if ok == n:
        t_max = max
        break
    max *= 2
    if max > 10**18:
        t_max = 0
        break
    ok = 0

print(t_max)

# def gcd(a, b):
#     while(b > 0):
#         c = a % b
#         a = b; b = c
#     return a
#
# n = ni()
# g = 0
# for i in range(n):
#     v = ni()
#     if g == 0:
#         g = v
#     else:
#         g = g//gcd(g,v)*v
# print(g)

Submission status: Wrong Answer

Solution code:
import sys

stdin = sys.stdin

n = int(stdin.readline())
t = [0]*n
for i in range(n):
    t[i] = int(stdin.readline())

max = max(t)
ok = 0
t_max = max
while max <= 10**18:
    for i in t:
        if max % i == 0:
            ok += 1
        else:
            break
    if ok == n:
        t_max = max
        break
    max *= 2
    ok = 0

print(t_max)

Submission status: Wrong Answer

Solution code:
import sys

stdin = sys.stdin

n = int(stdin.readline())
t = [0]*n
for i in range(n):
    t[i] = int(stdin.readline())

max = max(t)
for i in t:
    if max % i == 0:
        t_max = max
        break
    max *= 2

print(t_max)

Submission status: Wrong Answer

Solution code:
def m():
    N = int(input())
    T = [int(input()) for _ in range(N)]
    ans = []
    T.sort()
    for i in range(len(T)):
        tmp = T[i]
        flag = 0
        for k in range(i+1, len(T)):
            if T[k] % tmp == 0:
                flag = 1
                break
        if flag == 0:
            ans.append(tmp)
    ans = set(ans)
    a = 1
    for j in ans:
        a *= j
    return a

print(m())

Submission status: Wrong Answer

Solution code:
def m():
    N = int(input())
    T = [int(input()) for _ in range(N)]
    ans = []
    T = list(set(T))
    T.sort()
    for i in range(len(T)):
        tmp = T[i]
        flag = 0
        for k in range(i+1, len(T)):
            if T[k] % tmp == 0:
                flag = 1
                break
        if flag == 0:
            ans.append(tmp)
    a = 1
    for j in ans:
        a *= j
    return a

print(m())

Submission status: Wrong Answer

Solution code:
def m():
    N = int(input())
    T = [int(input()) for _ in range(N)]
    ans = []
    T.sort()
    for i in range(N):
        tmp = T[i]
        flag = 0
        for k in range(i+1, N):
            if T[k] == tmp:
                continue
            if T[k] % tmp == 0:
                flag = 1
                break
        if flag == 0:
            ans.append(tmp)
    a = 1
    for j in ans:
        a *= j
    return a

print(m())

Submission status: Wrong Answer

Solution code:
def m():
    N = int(input())
    T = [int(input()) for _ in range(N)]
    ans = []
    T.sort()
    for i in range(N):
        tmp = T[i]
        flag = 0
        for k in range(i+1, N):
            if T[k] % tmp == 0:
                flag = 1
                break
        if flag == 0:
            ans.append(tmp)
    a = 1
    for j in ans:
        a *= j
    return a

print(m())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

# AtCoder Beginner Contest
# Problem C

if __name__ == '__main__':
    from collections import Counter

    n = int(input())
    t = sorted(Counter([int(input()) for _ in range(n)]).keys(), reverse=True)
    result = t.pop(0)

    while t:
        can_divided = True

        for ti in t:
            if result % ti != 0:
                can_divided = False

        if can_divided:
            print(result)
            exit()

        result *= t.pop(0)

    print(result)

Submission status: Wrong Answer

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

# AtCoder Beginner Contest
# Problem C

if __name__ == '__main__':
    from collections import Counter

    n = int(input())
    t = sorted(Counter([int(input()) for _ in range(n)]).keys(), reverse=True)
    result = t.pop(0)

    while t:
        can_divided = True

        for ti in t:
            if result % ti != 0:
                can_divided = False

        if can_divided:
            print(result)
            exit()

        result *= t.pop(0)

    print(min(result, 10 ** 18))

Submission status: Wrong Answer

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

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

print(int(ss))

Submission status: Wrong Answer

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

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

ans = 1

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

print(ans)

Submission status: Wrong Answer

Solution code:
n,t=int(input()),1
for i in range(n):
    s=int(input())
    if s>t: s,t=t,s
    r=t%s
    if r!=0: t=t*s//r
print(t)

Submission status: Wrong Answer

Solution code:
n = int(input())
num = []

def GoJoHo(a,b):
  if max(a,b) % min(a,b) == 0:
    return min(a,b)
  if min(a,b) % max(a,b) % min(a,b) == 0:
    return max(a,b) % min(a,b)
  else:
    return GoJoHo(min(a,b),max(a,b)%min(a,b))
  
for i in range(n):
  tmp = int(input())
  if tmp not in num:
    num.append(tmp)
num.sort()
result = 1
for j in range(len(num)):
  work = num[0]
  num.pop(0)
  result *= work
  if work > 1:
    for x in range(len(num)):
      num[x] = num[x]//GoJoHo(num[x],work)
    num.sort()
print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())
num = []
for i in range(n):
  tmp = int(input())
  if tmp not in num:
    num.append(tmp)
num.sort()
result = 1
for j in range(len(num)):
  work = num[0]
  num.pop(0)
  result *= work
  if work > 1:
    for x in range(len(num)):
      if num[x]%work == 0:
        num[x] = num[x]//work
    num.sort()
print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())
num = []
for i in range(n):
  tmp = int(input())
  if tmp not in num:
    num.append(tmp)
num.sort()
dived = []
for j in range(len(num)):
  work = num[0]
  num.pop(0)
  if work > 1:
    dived.append(work)
    for x in range(len(num)):
      if num[x]%work == 0:
        num[x] = num[x]//work
    num.sort()
result = 1
for z in range(len(dived)):
  result *= dived[z]
print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())
num = []
for i in range(n):
  tmp = int(input())
  if tmp not in num:
    num.append(tmp)
num.sort()
dived = []
for j in range(len(num)):
  work = num[0]
  num.pop(0)
  dived.append(work)
  for x in range(len(num)):
    if num[x]%work == 0:
      num[x] = num[x]//work
  num.sort()
result = 1
for z in range(len(dived)):
  result *= dived[z]
print(result)

Submission status: Wrong Answer

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

tmp = int(input())
res = 0
for i in range(n-1):
    tmp2 = int(input())
    res = lcm(tmp, tmp2)
print(res)

Submission status: Wrong Answer

Solution code:
def gcd(a,b):
    if b == 0: return a
    if a < b: a, b = b, a
    if a % b == 0: return 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))