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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a.sort()
for i in range(n):
  s=a[i]
  f=0
  for j in range(i+1,n):
    if a[j] % s==0:
      f=1
  if f==0:
    b.append(s)

x=1
for i in b:
  x=x*i
print(x)

Submission status: Wrong Answer

Solution code:
import fractions
def main():
    n = int(input())

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



if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
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())
if n==1:
    print(int(input()))
    exit()
ans=0
for i in range(n):
    ans=lcm(ans,int(input()))
print(int(ans))

Submission status: Wrong Answer

Solution code:
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())
if n==1:
    print(int(input()))
    exit()
ans=0 #変数の数値に意味はない
for i in range(n):
    ans=lcm(ans,int(input()))
print(int(ans))

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

Submission status: Wrong Answer

Solution code:
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 *= ls[i]
    
print(ans)

Submission status: Wrong Answer

Solution code:
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[j])
        j+=1
    
if not mod_flag:
    ans = mxt

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

Submission status: Wrong Answer

Solution code:
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[j])
        j+=1
    
if not mod_flag:
    ans = mxt

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
t = []
for i in range(n):
  t.append(int(input()))
b = sorted(t)[-1]

for i in range(1, 10000000):
  b = b * i
  count = 0
  for j in range(n):
    if not b % t[j] == 0:
      break
    else:
      count += 1
  
  if count == n:
    print(b)
    break

Submission status: Wrong Answer

Solution code:
n = int(input())
t = []
for i in range(n):
  t.append(int(input()))
b = sorted(t)[-1]

for i in range(1, 10):
  b = b * i
  count = 0
  for j in range(n):
    if not b % t[j] == 0:
      break
    else:
      count += 1
  
  if count == n:
    print(b)
    break

Submission status: Wrong Answer

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

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

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

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

print (time)

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

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

print(int(ans))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
N = int(input().rstrip())
list =[]
for i in range(N):
    tmp = int(input())
    if tmp > 1:
        list.append(tmp)
list.sort()

itemList ={}
while len(list) > 0:
    work = list[0]
    if str(work) in itemList:
        itemList[(str(work))] += 1
    else:
        itemList[(str(work))] = 1
    list.remove(work)
    counter = 0
    while counter < len(list):
        if list[counter] == work:
            list.pop(counter)
        else:
            if list[counter] % work == 0:
                list[counter] = (list[counter]//work)
            counter += 1
    list.sort()
    
result = 1    
for key,value in itemList.items():
    result = result*(int(key)**value)
    
print(result)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
N = int(input().rstrip())
list =[]
for i in range(N):
    tmp = int(input())
    if tmp > 1:
        list.append(tmp)
list.sort()

itemList ={}
while len(list) > 0:
    print(list)
    work = list[0]
    if str(work) in itemList:
        itemList[(str(work))] += 1
    else:
        itemList[(str(work))] = 1
    list.remove(work)
    counter = 0
    while counter < len(list):
        if list[counter] == work:
            list.pop(counter)
        else:
            if list[counter] % work == 0:
                list[counter] = (list[counter]//work)
            counter += 1
    list.sort()
    
result = 1    
for key,value in itemList.items():
    result = result*(int(key)**value)
    
print(result)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
N = int(input().rstrip())
list =[]
for i in range(N):
    tmp = int(input())
    if tmp > 1:
        list.append(tmp)
list.sort()

itemList ={}
while len(list) > 0:
    if list[0] in itemList:
        itemList.update(str(list[j]), itemList[list[0]]+1)
    else:
        itemList[(str(list[0]))] = 1
    for k in range(1,len(list)):
        if list[k] % list[0] == 0:
            list[k] = (list[k]//list[0])
    list[0] = 1
    list.remove(1)
    list.sort()
    
result = 1    
for key,value in itemList.items():
    result = result*(int(key)**value)
    
print(result)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
N = int(input().rstrip())
list =[]
for i in range(N):
    tmp = int(input())
    if tmp > 1:
        list.append(tmp)
list.sort()

itemList ={}
while len(list) > 0:
    if list[0] in itemList:
        itemList.update(str(list[j]), itemList[list[0]]+1)
    else:
        itemList[(str(list[0]))] = 1
    for k in range(len(list)):
        if list[k] % list[0] ==0:
            list[k] = (list[k]//list[0])
    list.remove(1)
    list.sort()
    
result = 1    
for key,value in itemList.items():
    result = result*(int(key)**value)
    
print(result)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
# list: ソート済配列
# n: 参照番号
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)]
print(int(gcd(T, N-1)))

Submission status: Wrong Answer

Solution code:
import fractions

n = int(raw_input())
a = []
for i in xrange(n):
	a.append(int(raw_input()))
lcm = reduce(lambda x,y: x*y, a) / reduce(lambda x,y: fractions.gcd(x,y), a)
print lcm

Submission status: Wrong Answer

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

Tmax = max(T)
count = 1
Tcopy = T
while True:
    can = Tmax * count
    
    for Ti in T:
        if can%Ti==0:
            Tcopy.remove(Ti)
        else:
            break
            
    else:
        print(can)
        break
    T = Tcopy    
    count += 1

Submission status: Wrong Answer

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

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

def main():
    n = int(input())
    # t = sorted(list(set(readAll_int())))
    t = readAll_int()
    t = [(i+1)*10**18 for i in range(100)]
    for i in range(len(t) - 1):
        a = lcm(t[i], t[i+1])
        t[i+1] = a
    print(a)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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


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

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

max_lcm = 0
tmplcm = t[0]
for i in range(1,n):
    tmplcm = lcm(tmplcm,t[i])
    max_lcm = max(tmplcm,max_lcm)
print(max_lcm)

Submission status: Wrong Answer

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

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


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

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

max_lcm = 0
for i in range(1,n):
    max_lcm = max(lcm(t[0],t[i]),max_lcm)
print(max_lcm)

Submission status: Wrong Answer

Solution code:
import fractions

N = int(input())

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

ans = T[0]

for i in T:
    ans = ans*i/fractions.gcd(ans, i)

print(int(ans))

Submission status: Wrong Answer

Solution code:
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[0],t[i+1])
print(t[n-1])

Submission status: Wrong Answer

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

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
    
def lcm(a, b):
	return a * b // gcd (a, b)
if N == 1:
    print(N)
else:
    result = lcm(T[0],T[1])

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

    print(result)

Submission status: Wrong Answer

Solution code:
def yuclid(a, b):
    while b != 0:
        a, b = b, a % b
    return a

N = int(input())
t = [int(input()) for i in range(N)]
for i in range(N-1):
    t[i+1] = t[i]*t[i+1]/yuclid(t[i], t[i+1])

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

Submission status: Wrong Answer

Solution code:
# ユークリッド互除法
def yuclid(a, b):
    while b != 0:
        a, b = b, a % b
    return a

N = int(input())
t = [int(input()) for i in range(N)]
for i in range(1, N):
    t[i] = t[i-1]*t[i]/yuclid(t[i - 1], t[i])

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

Submission status: Wrong Answer

Solution code:
import copy
N = int(input())
T = [int(input()) for i in range(N)]
t = copy.deepcopy(T)
print(t ,T)
for i in range(N):
    print(i)
    if i != N-1:
        while t[i] != t[i+1]:
            if t[i] < t[i+1]:
                t[i] = t[i] + T[i]
            elif t[i] > t[i+1]:
                t[i+1] = t[i+1] + T[i+1]
        T[i+1] = t[i+1]
print(t)

Submission status: Wrong Answer

Solution code:
import sys

def scp(a, b):
    if b > a:
        tmp_a = a
        a = b
        b = tmp_a
    while b:
        r = a % b
        a = b
        b = r
    return a
    #for i in xrange(100000, 2, -1):
    #    if a % i == b % i == 0:
    #        return a * b / i
    #return a * b

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

array.sort()

if array[-1] > pow(10, 9):
    print array[-1]
    sys.exit(0)

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

Submission status: Wrong Answer

Solution code:
import sys

def scp(a, b):
    if a > b:
        if a % b == 0:
            return a
    else:
        if b % a == 0:
            return b
    for i in xrange(100000, 2, -1):
        if a % i == b % i == 0:
            return a * b / i
    return a * b

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

array.sort()

if array[-1] > pow(10, 9):
    print array[-1]
    sys.exit(0)

result = array[0]
for i in array[1:]:
    result = scp(result, i)
print result

Submission status: Wrong Answer

Solution code:
import sys

def scp(a, b):
    if a > b:
        if a % b == 0:
            return a
    else:
        if b % a == 0:
            return b
    for i in xrange(100000, 2, -1):
        if a % i == b % i == 0:
            return a * b / i
    return a * b

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

array.sort()

if array[-1] > pow(10, 9):
    sys.exit(0)

result = array[0]
for i in array[1:]:
    result = scp(result, i)
print result

Submission status: Wrong Answer

Solution code:
import sys

def scp(a, b):
    if a > b:
        if a % b == 0:
            return a
    else:
        if b % a == 0:
            return b
    for i in xrange(100000, 2, -1):
        if a % i == b % i == 0:
            return a * b / i
    return a * b

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

array.sort()
print array

if array[-1] > pow(10, 9):
    print array[-1]
    sys.exit(0)

result = array[0]
for i in array[1:]:
    result = scp(result, i)
print result

Submission status: Wrong Answer

Solution code:
import sys

def euclid(a, b):
    while a != b:
        if a > b:
            if a % b == 0:
                return b
            a = a-b
        else:
            if b % a == 0:
                return a
            b = b-a
    return a

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

array.sort()

if array[-1] > pow(10, 9):
    print array[-1]
    sys.exit(0)


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
5
2
5
10
1000000000000000000
1000000000000000000

Submission status: Wrong Answer

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

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

a = t_list[0]
for c in range(N-1):
	b = t_list[c+1]
	a =a*b/gcd(a,b)

print(a)

Submission status: Wrong Answer

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

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

a = t_list[0]
for c in range(N-1):
	b = t_list[c+1]
	a =a*b/gcd(a,b)

print(a)

Submission status: Wrong Answer

Solution code:
import fractions

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

n = int(input())

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

print(int(ans))

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-
N = int(input())
T = [ int(input()) for tmp in range(N) ]
a = list(reversed(sorted(list(set(T)))))
b = a[0]
ans = a.pop(0)
for tmp in a:
    if b%tmp != 0:
        ans *= tmp
    else:
        pass
print(ans)

Submission status: Wrong Answer

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

    c=a%b

    if c==0:
     return b
    else:
     return gcd(b,c)
'''

def gcd(a,b):
    if a<b:
        d=a
        a=b
        b=d
        
    while 1:
        if b==0:
         return a
        d=a
        a=b
        b=d%b

def lcm(e,f):
    c=gcd(e,f)
    return e/c*f



n=int(input())
t=[0]*n

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

ans=t[0]

for lop in range(1,n):
    ans=lcm(ans,t[lop])
print(int(ans))

Submission status: Wrong Answer

Solution code:
def gcd(a,b):
    if a<b:
        d=a
        a=b
        b=d
    d=a%b
    while d!=0:
        a=b
        b=d
        d=a%b
    return b

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



n=int(input())
t=[0]*n

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

ans=t[0]

for lop in range(1,n):
    ans=lcm(ans,t[lop])
print(int(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def gcd(a,b):
    if a<b:
     c=a
     a=b
     b=c
     
    c=a%b
    return b
 
def lcm(a,b):
    c=gcd(a,b)
    return a/c*b
 
 
 
n=int(input())
t=[0]*n
 
for lop2 in range(n):
    t[lop2]=int(input())
 
ans=t[0]
 
for lop in range(1,n):
    ans=lcm(ans,t[lop])
print(int(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def gcd(a,b):
    if a<b:
     c=a
     a=b
     b=c
     
    c=a%b
    return b
 
def lcm(a,b):
    c=gcd(a,b)
    return a/c*b
 
 
 
n=int(input())
t=[0]*n
 
for lop2 in range(n):
    t[lop2]=int(input())
 
ans=t[0]
 
for lop in range(1,n):
    ans=lcm(ans,t[lop])
print(int(ans))

Submission status: Wrong Answer

Solution code:
def gcd(a,b):
    if a<b:
     c=a
     a=b
     b=c
    return b
 
def lcm(a,b):
    c=gcd(a,b)
    return a/c*b
 
 
 
n=int(input())
t=[0]*n
 
for lop2 in range(n):
    t[lop2]=int(input())
 
ans=t[0]
 
for lop in range(1,n):
    ans=lcm(ans,t[lop])
print(int(ans))

Submission status: Wrong Answer

Solution code:
def gcd(a,b):
    return b
 
def lcm(a,b):
    c=gcd(a,b)
    return a/c*b
 
 
 
n=int(input())
t=[0]*n
 
for lop2 in range(n):
    t[lop2]=int(input())
 
ans=t[0]
 
for lop in range(1,n):
    ans=lcm(ans,t[lop])
print(int(ans))

Submission status: Wrong Answer

Solution code:
def gcd(a,b):
    return b

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



n=int(input())
t=[0]*n

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

ans=t[0]

for lop in range(1,n):
    ans=lcm(ans,t[lop])
print(int(ans))

Submission status: Wrong Answer

Solution code:

def lcm(a,b):
    c=1;
    return a/c+b



n=int(input())
t=[0]*n

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

ans=t[0]

for lop in range(1,n):
    ans=lcm(ans,t[lop])
print(int(ans))

Submission status: Wrong Answer

Solution code:
n=int(input())
t=[0]*n

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

ans=t[0]

for lop in range(1,n):
    ans=ans+t[lop]
print(int(ans))

Submission status: Wrong Answer

Solution code:
n=int(input())
t=[0]*n

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


print(4)

Submission status: Wrong Answer

Solution code:
n = int(input())
t = [int(input())]
for i in range(1,n):
    t.append(int(input()))
tmax = max(t)
gcd = tmax
sup = 10**3
while(gcd < sup):
    tmp = 0
    for i in t:
        if (gcd % i) != 0:
            tmp += 1
            break
    if tmp == 0:
        break
    else :
        gcd+=tmax

print(gcd)

Submission status: Wrong Answer

Solution code:
n = int(input())
t = [int(input())]
for i in range(1,n):
    t.append(int(input()))
tmax = max(t)
sup = 10**18
while(tmax < sup):
    tmp = 0
    for i in t:
        if (tmax % i) != 0:
            tmp += 1
            break
    if tmp == 0:
        break
    else :
        tmax+=tmax

print(tmax)

Submission status: Wrong Answer

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

import fractions
def gcd(a, b):
    return fractions.gcd(a, b)

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

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


if x <= 10 ** 18:
    print(x)
else:
    print(10 ** 18)

Submission status: Wrong Answer

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

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

gcd = 1
x = 1

for i in range(N):
    for j in range(N):
        gcd = int(fractions.gcd(T[i] , T[j]))
        x = max(lcm(T[i], T[j]), x)

if x <= 10 ** 18:
    print(x)
else:
    print(10 ** 18)

Submission status: Wrong Answer

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

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

gcd = 1
x = 0

for i in range(N):
    for j in range(N):
        gcd = int(fractions.gcd(T[i] , T[j]))
        x = max(lcm(T[i], T[j]), x)

print(x)

Submission status: Wrong Answer

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

import fractions
def lcm(a, b):
    if gcd != 0:
        return (a * b) // gcd
    else:
        return 0

gcd = 0
x = 0

for i in range(N):
    for j in range(N):
        gcd = int(fractions.gcd(T[i] , T[j]))
        x = max(lcm(T[i], T[j]), x)

print(x)

Submission status: Wrong Answer

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

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

gcd = 0
x = 0

for i in range(N):
    for j in range(N):
        gcd = int(fractions.gcd(T[i] , T[j]))
        x = max(lcm(T[i], T[j]), x)

print(x)

Submission status: Wrong Answer

Solution code:
n = int(input())

lcm = 0
gcd = 0

for i in range(n):
    t = int(input())
    if(i == 0):
        lcm, gcd = t, t
        continue
    lcm = t
    r = gcd % t
    while(r!=0):
        lcm = r
        r = t % r
    gcd *= t
    gcd //= lcm
    print(gcd)

Submission status: Wrong Answer

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

import fractions

gcd = 0
lcm = 0

for i in range(N):
    for j in range(N):
        gcd = int(fractions.gcd(T[i] , T[j]))
        lcm = int(max( (T[i] * T[j])/gcd, lcm))

print(lcm)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
b=1;
for i in range(0,n):
  a=int(input())
  b=b*a;
print(b)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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



def gcd(a, b):
	r = max(a, b) % min(a, b)
	


	if (r == 0):
		return max(a, b)

	else:
		return r * min(a, b) // gcd(r, min(a, b))




def GCD(T):
	l = len(T)



	if(l == 1):
		return T[0]

	elif(l == 2):
		return gcd(T[0], T[1])



	T1, T2 = [], []

	for i in range(l // 2):
		T1.append(T[i])

	for j in range(l - l // 2):
		T2.append(T[j + l // 2])



	return gcd(GCD(T1), GCD(T2))



print(GCD(T))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from functools import reduce

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

Submission status: Wrong Answer

Solution code:
from functools import reduce

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

c = 1
for T in Ts:
    c = lcm(c, T)
print(int(c))

Submission status: Wrong Answer

Solution code:
from functools import reduce

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

c = 1
for T in Ts:
    c = lcm(c, T)

print(c)

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

anser=1
for i in t:
    anser=lcm(anser,i)
print(anser)

Submission status: Wrong Answer

Solution code:
from math import sqrt
N = int(input())

factors = {}
for i in range(N):
    T = int(input())
    count = 0
    while T % 2 == 0:
        count += 1
        T //= 2
    try:
        if count > factors[2]:
            factors[2] = count
    except KeyError:
        factors[2] = count

    for j in range(3,int(sqrt(T)),2):
        count = 0
        while T % j == 0:
            count += 1
            T //= j
        try:
            if count > factors[j]:
                factors[j] = count
        except KeyError:
            factors[j] = count
        if j > T:
            break

    if T > 2:
        try:
            if factors[T] < 2:
                factors[T] = 1
        except KeyError:
            factors[T] = 1

result = 1
for i in factors.keys():
    while factors[i] > 0:
        result *= i
        factors[i] -= 1

print(result)

Submission status: Wrong Answer

Solution code:
def uq(a,c):
    while(a%c!=0):
        newa=c
        c=a%c
        a=newa
    return c
        

n=(int)(input())

result = 1

for j in range(0,n):
    f=(int)(input())
    result=((result/uq(result,f)))*f
    
print((int)(result))

Submission status: Wrong Answer

Solution code:
n = int(input())
t_set = set()
max = 0
for i in range(n):
	t = int(input())
	if t > max:
		max = t
 
	t_set.add(t)
 
times = 0
is_not_divisible = True
while is_not_divisible:
	times += 1
	d_list = []
	for t in t_set:
		if (max*times)%t != 0:
			is_not_divisible = True
			break
		else:
			d_list.append(t)
			is_not_divisible = False

	for d in d_list:
		t_set.remove(d)
 
print(max*times)

Submission status: Wrong Answer

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

t_list = sorted(t_list)[::-1]
t_min = t_list[0]
for i in range(len(t_list)-1):
	if t_min%t_list[1+i] != 0:
		t_min *= t_list[1+i]

print(t_min)

Submission status: Wrong Answer

Solution code:
from fractions import gcd

N = int(input())
T = []
for i in range(N):
    T.append(int(input()))
for i in range(N-1):
    T.append(T[0]*T[1]/gcd(T[0], T[1]))
    T.pop(0)
    T.pop(0)
print(int(T[0]))

Submission status: Wrong Answer

Solution code:
from functools import reduce

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

N = int(input())
Ts = []
for i in range(N):
    Ts.append(int(input()))
if len(Ts) >= 2:
    print(int(reduce(lambda x,y: x*y / gcd(x,y), Ts)))
else:
    print(int(Ts[0]))

Submission status: Wrong Answer

Solution code:
from functools import reduce

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

N = int(input())
Ts = []
for i in range(N):
    Ts.append(int(input()))
if len(Ts) >= 2:
    print(reduce(lambda x,y: x*y/ gcd(x,y), Ts))
else:
    print(Ts[0])