Least common multiple

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

Input

Input consists of several cases. Each case begins with a number n ≥ 1,
followed by x₁…x_(n). A special case with n = 0 marks the end of input.

Output

For every case, print in a line the least common multiple greater than
zero of x₁…x_(n). For the given cases, this number will always be
between 1 and 10⁹.

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T12:11:43.887Z

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