LG - LCM Game
Asad is a student of class 6. He loves to learn new logic from Number Theory. He receives a gift from his Mom named “LCM game”. In the game, He is given some integer and he need to find the LCM of the given integers. But he is facing some problem to find the LCM of more than two integers.
In this case, He ask for your help to find the LCM of given N integers. As you are a great programmer in our country.
Input
Every line of input contains a single integer N denoting the number of integers (until EOF) that is given to him.
Next line contain N spaces separated integer x1,x2,x3,………,xn.
Constraints:
1<=N<= 105
1<=xi<=109
Output
For each input, print a single line and the value of the LCM of N integers.
Example
Input:2
1 2
3
2 3 4
Output:2
12
2
1 2
3
2 3 4
Note: In second test case, LCM(2,3) = 6 and LCM(6,4) = 12
hide comments
AJ:
2021-03-04 01:41:39
asad_IT - wrong input
|
|
mossab:
2020-10-28 15:09:58
is there any way to solve the time limit problem in the codes?
|
|
le_hue_369:
2020-05-14 02:47:55
After a bunch of trying , it's still"runtime error". |
Added by: | asad_IT |
Date: | 2018-07-11 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |
Resource: | Math |