#K6681. Smallest Multiple

    ID: 32503 Type: Default 1000ms 256MiB

Smallest Multiple

Smallest Multiple

Given a list of positive integers, find their Least Common Multiple (LCM). For two numbers \(a\) and \(b\), the LCM is defined as

[ \text{lcm}(a,b)=\frac{a\times b}{\gcd(a,b)} ]

For more than two numbers, the LCM can be computed iteratively by applying the above formula pairwise. Your task is to compute the LCM of the list of numbers provided as input.

Note: The input format guarantees that all numbers are positive integers and the list may contain one or more numbers.

inputFormat

The first line contains a single integer \(n\) representing the number of positive integers.

The second line contains \(n\) positive integers separated by spaces.

outputFormat

Output a single integer which is the Least Common Multiple (LCM) of the given numbers.

## sample
3
5 7 11
385

</p>