https://www.codechef.com/problems/RECTSQ

https://www.codechef.com/problems/RECTSQ

Can anyone explain this problem

So you have been given N and M, You need to divide the area into P squares such that dimensions of all the P squares is the same and P is as minimum as possible. Considering N = 10,M = 15 if we consider the square side length to be 5, then the area is divided into six squares. if we consider the sqaure side length to be 1, then the area is divided into 150 squares. Since 6 is smaller than 150, our answer is 6.
I hope you understood the problem now.

but in this problem size of squares should be same is not mentioned

but in this problem size of squares should be same is not mentioned .

Yeah, they haven’t mentioned that in the problem. By studying the sample testcases, I inferred that the square side lengths should be equal.