TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

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

A, B, C, D = map(int, input().split())
if min(B, D)-max(A, C)>0:
	print(min(B, D)-max(A, C))
else:
	print(0)

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

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

A,B,C,D=map(int,input().split())
p=min(B,D)-max(A,C)
if p<=0:
  print(0)
else:
  print(p)

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a,b,c,d=map(int,input().split())
print(max(a,c)-min(b,d) if min(b,d)<max(a,c) else 0)

a,b,c,d=map(int,input().split())
print(min(b,d)-max(a,c) if min(b,d)<max(a,c) else 0)

a,b,c,d=map(int,input().split())
print(max(0,min(b,d)-max(a,c)))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
A,B,C,D = map(int,input().split())
ans = 0

# if B >= C:
#     if D >= A:
#         if A <= C:
#             ans = B-C
#         if A > C:
#             ans = B-A
    

# elif B >= D:
#     if D >= A:
#         if A <= C :
#             ans = D-C
#         if A > C:
#             ans = D-A


if A < C:
    if B > C:
        ans = max(A,C)-min(B,D)

    


print(ans)

A,B,C,D = map(int,input().split())
ans = 0

# if B >= C:
#     if D >= A:
#         if A <= C:
#             ans = B-C
#         if A > C:
#             ans = B-A
    

# elif B >= D:
#     if D >= A:
#         if A <= C :
#             ans = D-C
#         if A > C:
#             ans = D-A


if min(B,D)>=max(A,C):
    ans = min(B,D)-max(A,C)

    


print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
# -*- coding: utf-8 -*-
A,B,C,D = map(int,input().split())
L = [A:B]
M = [C:D]
print(L&M)

A,B,C,D = map(int,input().split())

sup = max(D,B)
inf = min(A,C)

if B-A + D-C <= sup - inf:
    print(0)
else:
    print(B-A+D-C - (sup - inf))

Verdicts: Runtime Error

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

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

A,B,C,D = map(int,input().split(' '))
print(max(0,min(B,D)-max(A,C)))

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools

def j(q):
    if q==1: print("Yes")
    else:print("No")
    exit(0)


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())

def swap(s,pos):
    s[pos]-=1
    s[pos+1]+=1
    print(s)
    if pos == n-2: return s
    if s[pos+2] == 0: swap(s,pos+1)
    return s

pl = 'abcdefghijklmnopqrstuvwxyz'




a,b,c,d= (int(i) for i in input().split())  








e = set([i for i in range(a,b+1)])
f = set([i for i in range(c,d+1)])
print(len(e & f))

from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools

def j(q):
    if q==1: print("Yes")
    else:print("No")
    exit(0)


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())

def swap(s,pos):
    s[pos]-=1
    s[pos+1]+=1
    print(s)
    if pos == n-2: return s
    if s[pos+2] == 0: swap(s,pos+1)
    return s

pl = 'abcdefghijklmnopqrstuvwxyz'




a,b,c,d= (int(i) for i in input().split())  








e = set([i for i in range(a,b)])
f = set([i for i in range(c,d)])
print(len(e & f))

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
S = list(map(int,input().split()))
 
if S[0] =< S[1] =< S[2] =< S[3]:
    print (0)
    
elif S[0] =< S[2] =< S[3] =< S[1]:
    print(S[3]-S[2])
    
elif S[0] =< S[2] =< S[1] =< S[3]:
    print(S[1] - S[2])
    
elif S[2] =< S[0] =< S[3] =< S[1]:
    print(S[3] - S[0])
 
elif S[2] =< S[3] =< S[0] =< S[1]:
    print(0)

A,B,C,D=map(int,input().split())
 
if B<=C or D<=A:
    print(0)
elif A<=C and B<=D:
    print(B-C)
elif C<=A and D<=B:
    print(D-A)
elif A<=C and D<=B:
    print(D-C)
elif C<=A and B<=D:
    print(B-A)


Verdicts: Runtime Error

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a,b,c,d = map(int,input().split())

if max(b,d) > min(b,d):
    print(0)
else:
    print(min(b,d)-max(a,c))

a,b,c,d = map(int,input().split())

print(max(0,min(b,d)-max(a,c)))

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a,b,c,d = map(int,input().split())
max(0, min(b,d) - max(a,c))

a,b,c,d = map(int,input().split())
print(max(0, min(b,d) - max(a,c)))

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
if __name == '__main__':
    A, B, C, D = map(int, input().split())

    if B =< C or D =< A:
        print(0)
    else:
        if A < C:
            print(B-C)
        else:
            print(D - A)

if __name__ == '__main__':
    A, B, C, D = map(int, input().split())

    if B <= C or D <= A:
        print(0)
    else:
        if A < C:
            print(B-C)
        elif A > C
            print(D - A)
        else:
            if B < D:
                print(B-A)
            else:
                print(D-A)

if __name__ == '__main__':
    A, B, C, D = map(int, input().split())

    if B <= C or D <= A:
        print(0)
    else:
        if A < C:
            if B < D:
                print(B-C)
            else:
                print(D-C)
        elif A > C:
            if B < D:
                print(B-A)
            else:
                print(D-A)
        else:
            if B < D:
                print(B-A)
            else:
                print(D-A)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a, b, c, d = map(int, input().split())
if b <= c or d <= a:
    print(0)
elif c <= a and b <= d:
    print(b-a)
elif a <= c and d <= b:
    print(d-c)
elif a <= d:
    print(c-b)
else:
    print(d-a)

a, b, c, d = map(int, input().split())
if min(b, d) < max(a, c):
    print(0)
else:
    print(min(b, d)-max(a, c))

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
# coding: utf-8
line = input().rstrip().split()

A = int(line[0])
B = int(line[1])
C = int(line[2])
D = int(line[3])

if A <= C:
    if B<= C:
        print(0)
    else:
        if B<= D:
            print(C-B)
        else:
            print(D-C)
else:
    if A <= D:
        print(D-A)
    else:
        print(0)

# coding: utf-8
line = input().rstrip().split()

A = int(line[0])
B = int(line[1])
C = int(line[2])
D = int(line[3])

if A <= C:
    if B<= C:
        print(0)
    else:
        if B<= D:
            print(B-C)
        else:
            print(D-C)
else:
    if A <= D:
        if B <= D:
            print(B-A)
        else:
            print(D-A)
    else:
        print(0)

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a, b, c, d = map(int,input().split())
e = list(range(a,b+1))
d = list(range(c,d+1))
print(e)
l = []
for i in e:
  if i in d:
    l.append(i)
if l == []:
  print(0)
else:
  print(len(l)-1)

a, b, c, d = map(int,input().split())
e = list(range(a,b+1))
d = list(range(c,d+1))
#print(e)
l = []
for i in e:
  if i in d:
    l.append(i)
if l == []:
  print(0)
else:
  print(len(l)-1)

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a, b , c, d = map(int, input().split())
if b <= c or d>=a:
    print(0)
elif b > c and b <= d:
    print(d-c)
elif b > c:
    print(b-c)

    


a, b , c, d = map(int, input().split())
if b<=c or d <= a :
    print(0)
elif c<=b:
    if c <= a and b<=d:
        print(b-a)
    elif a<= c and b<=d:
        print(b-c)
    elif a<=c and d<=b:
        print(d-c)
    elif c<=a and d<=b:
        print(d-a)

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
A, B, C, D = map(int, input().split())

if A<C:
    A=C
if D<B:
    B=D

print(A-B)

A, B, C, D = map(int, input().split())

if A<C:
    A=C
if D<B
    B=D

print(A-B)

A, B, C, D = map(int, input().split())

ans=0

if A<C:
    A=C
if D<B:
    B=D

if B<C or D<A:
    ans=0
else:
    ans=A-B

print(ans)

A, B, C, D = map(int, input().split())

ans=0

if A<C:
    A=C
if D<B:
    B=D

if B<C:
    ans=0
else:
    ans=A-B

print(ans)

A, B, C, D = map(int, input().split())

ans=0

if A<C:
    A=C
if D<B:
    B=D

if B<C or D<A:
    ans=0
else:
    ans=abs(A-B)

print(ans)

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a,b,c,d = map(int, input().split())
print(max(0, min(b,d) - min(a,c)))

a,b,c,d = map(int, input().split())
print(max(0, min(b,d) - max(a,c)))


Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
A, B, C, D = map(int, input().split())
max(0, min(B, D) - max(A, C))

A, B, C, D = map(int, input().split())
print(max(0, min(B, D) - max(A, C)))

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

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

A,B,C,D=map(int,input().split())
print(max(0,min(B,D)-max(A,C)))

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
from sys import stdin
from itertools import groupby

a,b,c,d = [int(x) for x in stdin.readline().rstrip().split()]

if b < c or d < a:
    print(0)
elif b >= c and d <= b:
    print(d-c)
elif a >= c and b <= d:
    print(b-a)
elif a >= c:
    print(d-a)
elif c < a:
    print(b-c)

from sys import stdin
from itertools import groupby

a,b,c,d = [int(x) for x in stdin.readline().rstrip().split()]

if b < c or d < a:
    print(0)
elif b >= d and c >= a:
    print(d-c)
elif a >= c and b <= d:
    print(b-a)
elif a >= c:
    print(d-a)
elif c > a:
    print(b-c)

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
A,B,C,D = map(int,input().split())
 
inter1 = [i for i in range(A,B + 1)]
inter2 = [i for i in range(C,D + 1)]
 
inter3 = []
 
for i in range(0,max(B,D)):
  if i in inter1 and i in inter2:
    inter3.append(i)
    
if len(inter3) > 1:
  print(max(inter3) - min(inter3))
elif len(inter3) == 1:
  print(1)
else:print(0)
  
print(inter3)

A,B,C,D = map(int,input().split())

inter1 = {i for i in range(A,B + 1)}
inter2 = {i for i in range(C,D + 1)}

print(len(inter1 or inter2) - 1)

A,B,C,D = map(int,input().split())
 
alice = [i for i in range(A,B + 1)]
bob = [i for i in range(C,D + 1)]
 
common = [i for i in bob if i in alice]

if len(common) == 0:
  print(0)
else:
  print(len(common)-1)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

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

A,B,C,D = map(int, input().rstrip().split())
print(max([A,B]) - min([C,D])

A,B,C,D = map(int, input().rstrip().split())
print(min([B, D]) - max([A,C]) if min([B, D]) - max([A,C]) > 0 else 0)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
n=[0]*101
a,b,c,d=map(int,input().split())
n[a]+=1
n[b+1]-=1
n[c]+=1
n[d+1]-=1
for i in range(100):
  n[i+1]+=n[i]
ans=0
for i in n:
  if i==2:
    ans+=1
print(ans)

  


n=[0]*101
a,b,c,d=map(int,input().split())
n[a]+=1
n[b]-=1
n[c]+=1
n[d]-=1
for i in range(100):
  n[i+1]+=n[i]
ans=0
for i in n:
  if i==2:
    ans+=1
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):
5
2
5
10
1000000000000000000
1000000000000000000

N = int(input())
T = [int(input()) for _ 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)

l = 1

for i in T:
    l = lcm(l, i)

print(l)

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
sys.setrecursionlimit(10**18)
n=int(input())
t=[int(i) for i in sys.stdin]
def gcd(x,y):
  if y==0:
    return x
  return gcd(y,x%y)
x=t[0]
for i in range(1,n):
  y=x*t[i]//gcd(x,t[i])
  x=y
print(y)

import sys
sys.setrecursionlimit(10**8)
n=int(input())
t=[int(i) for i in sys.stdin]
if n==1:
  print(t[0])
  exit()
def gcd(x,y):
  if y==0:
    return x
  return gcd(y,x%y)
x=t[0]
for i in range(1,n):
  y=x*t[i]//gcd(x,t[i])
  x=y
print(y)

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(p, q):
    if p < q:
        p, q = q, p
    while q > 0:
        p, q = q, p%q
    return p

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

from fractions import gcd
n = int(input())
ans = 1
for i in range(n):
  t = int(input())
  ans = a*t//gcd(a, t)
print(ans)

def gcd(p, q):
    if p < q:
        p, q = q, p
    while q > 0:
        p, q = q, p%q
    return p

n = int(input())
ans = 1
for i in range(n):
  t = int(input())
  ans = ans*t//gcd(ans, t)
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):
// Created by sz
#include <bits/stdc++.h>
using namespace std;

const int N = 1e5 + 5;
int n;
long long a[N];


long long gcd(long long a, long long b){
    return b ? gcd(b, a % b) : a;
}



int main(){
#ifdef LOCAL
    freopen("./input.txt", "r", stdin);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    cin>>n;
    
    for (int i = 1; i <= n; i++)cin>>a[i];
    
    long long  lcm = 1;
    
    for (int i = 1; i <= n; i++){
        lcm = lcm/gcd(a[i], lcm)*a[i];
    }
    cout<<lcm<<endl;
    
    
    return 0;
}



import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

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


def solve():
    n = f()[0]
    a = []
    for i in range(n):
        a.append(f()[0])

    lcm = a[0]

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

    print(lcm)


solve()


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())
clock = [0]*N
gcd = int(input())
clock[0] = gcd
ans = clock[0]
for i in range(1, N):
    clock[i] = int(input())
    gcd = fractions.gcd(ans, clock[i])
    ans = ans*clock[i]/gcd

print(int(ans))


import fractions


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


N = int(input())
clock = [0]*N
gcd = int(input())
clock[0] = gcd
ans = clock[0]
for i in range(1, N):
    clock[i] = int(input())
    gcd = GCD(ans, clock[i])
    ans /= gcd
    ans *= clock[i]

print(int(ans))


import fractions
N = int(input())
clock = [0]*N
gcd = int(input())
clock[0] = gcd
ans = clock[0]
for i in range(1, N):
    clock[i] = int(input())
    gcd = fractions.gcd(ans, clock[i])
    ans /= gcd
    ans+=clock[i]

print(int(ans))


import fractions
N = int(input())
clock = [0]*N
gcd = int(input())
clock[0] = gcd
ans = clock[0]
for i in range(1, N):
    clock[i] = int(input())
    gcd = fractions.gcd(ans, clock[i])
    ans /= gcd
    ans*=clock[i]

print(int(ans))


import fractions
N = int(input())
lcd = 1
gcd = 1
for i in range(N):
    inp = int(input())
    gcd = fractions.gcd(lcd, inp)
    lcd = lcd * inp / gcd
print(int(lcd))


import fractions


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


N = int(input())
clock = [0] * N
for j in range(N):
    clock[j] = int(input())
gcd = clock[0]

ans = clock[0]
for i in range(1, N):
    gcd = GCD(ans, clock[i])
    ans = ans//gcd
    ans = ans * clock[i]

print(int(ans))


Verdicts: Wrong Answer

Runtime Error

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):
def l(a, b):
  if a > b:
    a, b = b, a
  return l(a, b % a) if b % a else a

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

N = int(input())
res = 1
for n in range(N):
  res = g(res, int(input())

print(res)

def l(a, b):
  if a > b:
    a, b = b, a
  return l(a, b % a) if b % a else a

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

N = int(input())
res = 1
for n in range(N):
  res = g(res, int(input()))

print(res)

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

n = int(input())
a = []  
  for i in range(n):
    a.append(int(input()))
if n == 1:
  print(a[0])
else:
  lcm = (a[0] * a[1]) // math.gcd(a[0], a[1])
  for i in range(2, n):
    lcm = (lcm * a[i]) // math.gcd(lcm, a[i])
  print(lcm)


import math

n = int(input())
a = []  
for i in range(n):
  a.append(int(input()))
if n == 1:
  print(a[0])
else:
  lcm = (a[0] * a[1]) // math.gcd(a[0], a[1])
  for i in range(2, n):
    lcm = (lcm * a[i]) // math.gcd(lcm, a[i])
  print(lcm)


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):
#ABC070C
import math
from functools import reduce
N=int(input())
T=[int(input()) for i in range(N)]
def lcm_base(x, y):
    interium=x/math.gcd(x, y)
    return (interium*y)
print(reduce(lcm_base, T))


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


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

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):
import sys

N = int(input())
T = sorted([int(input()) for i in range(N)])[::-1]
if len(T)==1:
    print(T[0])
    sys.exit()
def gcd(x,y):
    a = max(x,y)
    b = min(x,y)
    while b!=0:
        a,b = b,a%b
    return a

g = T[0]
for i in range(N-1):
    g = gcd(g,T[i+1])
print((T[0]*g)//g)

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

def gcd(x,y):
    a = max(x,y)
    b = min(x,y)
    while b!=0:
        a,b = b,a%b
    return a

g = T[0]
for i in range(N-1):
    g = (g*T[i+1])//gcd(g,T[i+1])
print(g)

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

t = sorted(t)[::-1]
biggest = t[0]
for i in range(biggest, 10**18+1, biggest):
    print(i)
    ok = True
    for j in t[1:]:
        if i%j != 0:
            ok = False
            break
    if ok == True:
        break
    
print(i)
            

n = int(input())
t = []
for i in range(n):
    t.append(int(input()))
    
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)

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

result = 1
for i in range(n):
    result = lcm(result, t[i])
    
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):
def gcd(a, b):
    if(a == 0):
        return b
    return gcd(b % a, a)
def lcm(a, b):
    return a / (gcd(a, b) * b) 
t = int(input())
ans = 1
while(t != 0):
    t -= 1
    n = int(input())
    ans = lcm(ans, n)
print(int(ans))


def gcd(a, b):
    if(a == 0):
        return b
    return gcd(b % a, a)
def lcm(a, b):
    return a // gcd(a, b) * b
t = int(input())
ans = 1
while(t != 0):
    t -= 1
    n = int(input())
    ans = lcm(ans, n)
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):
n = int(input())
a = [1]
for _ in range(n):
    a.append(int(input()))
for i in range(1, n+1):
    a[i] = lcm(a[i-1], a[i])
print(a[-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())
a = [1]
for _ in range(n):
    a.append(int(input()))
for i in range(1, n+1):
    a[i] = lcm(a[i-1], a[i])
print(a[-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):
n_in = int(input()) 
l = [int(input()) for i in range(n_in)] 

p = l[0]
for i in range(1, len(l)):
    q = l[i]

    if p >= q:
        m = p
        n = q
    else:
        m = q
        n = p

    while True:
        mod_value = m % n

        if mod_value  == 0:
            n = mod_value
            break

        m = n
        n = mod_value

    p = int(p*q/n)

print(p)

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

p = t[0]
for i in range(1, len(t)):
    q = t[i]

    if p >= q:
        m, n = p, q
    else:
        m, n = q, p

    while True:
        mod_value = m % n
        if mod_value  == 0:
            break

        m = n
        n = mod_value

    p = p//n * q

print(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):
from fractions import gcd

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

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

from fractions import gcd

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

for i in range(0,n-1):
    lcm=(t[i]*t[i+1]//gcd(t[i],t[i+1]))
    t[i+1]=lcm
print(lcm)

from math import gcd

n=int(input())

lcm=0
for i in range(n):
  t=int(input())
  if lcm==0:
    lcm=t
  else:
    lcm=(t*lcm)//gcd(t,lcm)

print(lcm)

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

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

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

N = int(input())

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

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

N = int(input())

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

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

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

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

res = 1
for i in range(N):
    d = gcd(res, a_list[i])
    res = res // d
    res = res * a_list[i]

print(res) 
 

N = int(input())
 
a_list = []
for _ in range(N):
    a_list.append(int(input()))
 
def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)
 
res = 1
for i in range(N):
    d = gcd(res, a_list[i])
    res = res // d
    res = res * a_list[i]
 
print(res) 

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

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

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

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

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

def lcm(a,b):
    return a*b//gcd(a,b)
T=[]
N=int(input())
for i in range(N):
    T.append(int(input()))

ans=1
for t in T:
    ans=lcm(ans, t)

print(int(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(x, y):
  while(x % y != 0 and y % x != 0):
    if(x > y):
      x = x % y
    else:
      y = y % x
  if(x > y):
    return y
  else:
    return x
  
N = int(input())
A = list()
for i in range(N):
  A.append(int(input()))

ans = 1
for i in range(N):
  gcd_i = gcd(A[i], ans)
  print(gcd_i)
  ans = A[i] * ans // gcd_i
  
print(ans)

def gcd(x, y):
  while(x % y != 0 and y % x != 0):
    if(x > y):
      x = x % y
    else:
      y = y % x
  if(x > y):
    return y
  else:
    return x
  
N = int(input())
A = list()
for i in range(N):
  A.append(int(input()))
for i in range(N):
  ans = 1
  gcd_i = gcd(A[i], ans)
  ans = A[i] * ans // gcd_i
  
print(ans)

def gcd(x, y):
  while(x % y != 0 and y % x != 0):
    if(x > y):
      x = x % y
    else:
      y = y % x
  if(x > y):
    return y
  else:
    return x
  
N = int(input())
A = list()
for i in range(N):
  A.append(int(input()))

ans = 1
for i in range(N):
  gcd_i = gcd(A[i], ans)
  ans = A[i] * ans // gcd_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):
def main():
    N = int(input())
    T = []
    for _ in range(N):
        T.append(int(input()))

    if N == 1: return 0

    g = T[0]
    ans = T[0]
    for t in T[1:]:
        gc = gcd(t, g)
        g = g*t//gc
    return g

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



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

    if N == 1: return T[0]

    g = T[0]
    ans = T[0]
    for t in T[1:]:
        gc = gcd(t, g)
        g = g*t//gc
    return g

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




if __name__ == '__main__':
    print(main())

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):
from functools import reduce

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

x = reduce(t, lcm)

print(x)



from functools import reduce

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

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

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)

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())
    ans=lcm(ans,t)
print(ans)

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 fractions

N = int(input())
T = []

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

T.sort
a = T[0]

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

print(int(a)) 


N = int(input())
T = []

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

a = 1

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

for i in range(N):
    a = a * T[i] // gcd(a,T[i])

print(a)


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

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)

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)

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):
def gcd(x, y):
	if x < y:
		x, y = y, x
	if y == 0:
		return x
	z = x % y
	return gcd(y, z) 
	
N=int(input())
prenum = 1
for i in range(N):
	T = int(input())
	lcm = prenum / gcd(prenum, T) * T
	prenum = lcm
print(str(lcm))

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

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 i in range(N):
    T.append(int(input()))
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
g = lcm(T[0],T[1])
if len(T) > 2:
    for i in range(N-1):
        g = lcm(g,T[i+1])
print(g)

import math
N = int(input())
T = []

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

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

    

if len(T) > 2:
    g = lcm(T[0],T[1])
    for i in range(3,N-1):
        g = lcm(g,T[i+1])
    print(g)
elif len(T) == 2:
    print(g)
else:
    print(T[0])

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

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

g = 1
for i in T:
    g = lcm(g,i)
    
print(g)

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


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


n=int(input())
t=list(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)
ans=t[0]
for i in range(n):
    ans=lcm(ans,t[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):
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
    else:
        return gcd(b, b%a)

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

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

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

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

print(l)

def gcd(x, y):
    if x > y:
        y, x = x, y
    if x == 0:
        return y
    return gcd(y % x, x)
 
 
def lcm(x, y):
    d = gcd(x, y)
    return x * y // d
 
 
N = int(input())
 
ans = 1
for _ in range(N):
    a = int(input())
    ans = lcm(ans, a)
print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted