Weak test cases, even editorial solution doesn't handle them


#1

If A,B,C are both close to 1e9, then the product will overflow, and we cant find the lcm, I wasted 20 mins trying to get around the overflow.

Even the editorial solution doesn’t handle that, one of the solutions tries to avoid overflow but that will fail for A,B,C prime.

I took a chance and removed the check for overflow, the solution passed, weak test cases;


#2

yes , you are right.
I too had the same problem.


#3

It is so true. I changed everything to BigInteger in Java and made it work.