So I calculated the lcm of the whole array using the inbuilt gcd function and iterated over m to find the lowest value between 1 and m that gives the highest lcm.
https://www.codechef.com/viewsolution/30842754
Thanks in advance
So I calculated the lcm of the whole array using the inbuilt gcd function and iterated over m to find the lowest value between 1 and m that gives the highest lcm.
https://www.codechef.com/viewsolution/30842754
Thanks in advance
LCM overflows range of integer.
Store prime factorization of LCM instead.
can you have a look at this please
https://discuss.codechef.com/something-fishy-with-mxmlcm-test-case/59217