Back
Close

Lowest Common Multiple

Statement
The program
Given a sequence of n numbers, calculate the lowest common multiple of elements of this sequence.
INPUT:
First line: one number n (the number of elements of the sequence).
Second line: n integers separated by spaces.

OUTPUT:
A single integer containing the lowest common multiple.

CONSTRAINTS:
1 <= n <= 1000
1 <= arr[i] <= 100

EXAMPLE:
Input
4
42 6 11 83
Output
38346
 

Game modes
FastestReverse

Test cases
Test n°1 Test
Input
4 42 6 11 83
Output
38346

Test n°2 Test
Input
10 42 6 11 83 96 17 55 85 35 87
Output
1512366240

Test n°3 Test
Input
2 3 2
Output
6

Test n°4 Test
Input
3 15 3 5
Output
15

Test n°5 Test
Input
2 5 6
Output
30

Solution language

Solution

Stub generator input
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants