Help with MXMLCM

https://www.codechef.com/viewsolution/30869601

I don’t understand why this approach isn’t working.

@rishabgt
In this case , LCM may get out of the range of long long data type for some test case. for example if there is an array which have only prime numbers till the given range 10^4, then see your lcm will get out of bound.

1 Like

@rishabgt
Hint: Use (prime factor) to solve this question :slight_smile:

1 Like

What is wrong with this code?? PLease help!!
https://www.codechef.com/viewsolution/30859741