Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
N = int(input())
T = sorted(list(set([int(input()) for _ in range(N)])), reverse=True)
ret = 1
while len(T) > 1:
  C = int(max(T) ** 0.5)
  f = False
  for c in range(2, C + 1):
    T_ = deque([])
    for i, t in enumerate(T):
      if t % c == 0:
        T_.append(t // c)
        f = True
      elif t < c:
        ret *= t
      else:
        T_.append(t)
    T = sorted(list(set([t for t in T_ if t >= c])), reverse=True)
    if f:
      ret *= c
      break
  else:
    break
for t in T:
  ret *= t
print(ret)

Fixed submission:
from collections import deque
N = int(input())
T = list(set([int(input()) for _ in range(N)]))
ret = T[0]

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

for t in T[1:]:
  ret = ret * t // gcd(ret, t)
  
print(ret)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
T = sorted(list(set([int(input()) for _ in range(N)])), reverse=True)
ret = 1
while len(T) > 1:
  C = int(max(T) ** 0.5)
  f = False
  for c in range(2, C + 1):
    T_ = []
    for i, t in enumerate(T):
      if t % c == 0:
        T_.append(t // c)
        f = True
      elif t < c:
        ret *= t
      else:
        T_.append(t)
    T = sorted(list(set([t for t in T_ if t >= c])), reverse=True)
    if f:
      ret *= c
      break
  else:
    break
for t in T:
  ret *= t
print(ret)

Fixed submission:
from collections import deque
N = int(input())
T = list(set([int(input()) for _ in range(N)]))
ret = T[0]

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

for t in T[1:]:
  ret = ret * t // gcd(ret, t)
  
print(ret)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
T = sorted(list(set([int(input()) for _ in range(N)])), reverse=True)
ret = []
while len(T) > 1:
  C = int(max(T) ** 0.5)
  f = False
  for c in range(2, C + 1):
    if T[-1] < c:
      ret.append(T[-1])
      T = T[:-1]
    T_ =  T[:]
    for i, t in enumerate(T):
      if t % c == 0:
        T_[i] = t // c
        f = True
    if f:
      ret.append(c)
      T = sorted(list(set(T_[:])), reverse=True)
      break
  else:
    break

ret += T
ans = 1
for r in ret:
  ans *= r
print(ans)

Fixed submission:
from collections import deque
N = int(input())
T = list(set([int(input()) for _ in range(N)]))
ret = T[0]

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

for t in T[1:]:
  ret = ret * t // gcd(ret, t)
  
print(ret)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
T = sorted(list(set([int(input()) for _ in range(N)])), reverse=True)
ret = []
while len(T) > 1:
  C = int(max(T) ** 0.5)
  f = False
  for c in range(2, C + 1):
    if T[-1] < c:
      ret.append(T[-1])
      T = T[:-1]
    T_ =  T[:]
    for i, t in enumerate(T):
      if t % c == 0:
        T_[i] = t // c
        f = True
    if f:
      ret.append(c)
      T = sorted(list(set(T_[:])), reverse=True)
      break
  else:
    break

ret += T
ans = 1
for r in ret:
  ans *= r
print(ans)

Fixed submission:
from collections import deque
N = int(input())
T = list(set([int(input()) for _ in range(N)]))
ret = T[0]

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

for t in T[1:]:
  ret = ret * t // gcd(ret, t)
  
print(ret)