Least common multiple

Your task is to write a program such that, given n strictly positive
natural numbers x₁, …, x_(n), prints their least common multiple greater
than zero.

Input

The input consists of zero or more cases. Each case consists of two
lines: the first one with a natural n ≥ 1; the second one with
x₁, …, x_(n). A special line with n = 0 indicates the end of the input.

Output

For each case of the input, your program must print in a line the least
strictly positive common multiple of x₁, …, x_(n).

Observation

Use the function |gcd()| of the exercise MCD3.

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T11:12:20.368Z

© Jutge.org, 2006–2026.
https://jutge.org
