Above is the problem code
Here we need to find the minimum number of squares for an area of a rectangle and i have done like taking the minimum of length or breadth which is divisible and then printing it.
But no getting the correct answer.
there are solutions related to gcd please don’t suggest that.
Since you want to have minimum number of squares , you have to have largest square. So you need to find maximum factor (i.e gcd) and then simply (length/gcd)*(breadth/gcd) is your answer.
I don’t think there’s any other way. You have to use the concept of gcd.