Your task is to write a program such that, given strictly positive natural numbers , prints their least common multiple greater than zero.
The input consists of zero or more cases. Each case consists of two lines: the first one with a natural ; the second one with . A special line with indicates the end of the input.
For each case of the input, your program must print in a line the least strictly positive common multiple of .
Use the function |gcd()| of the exercise MCD3 .
Salvador Roura (en: Carlos Molina)
© Jutge.org, 2006–2025.
Input
3 14 4 5 1 7 0
Output
140 7