RECTANGL problem code

https://www.codechef.com/viewsolution/26077830
can anyone tell me what is wrong with this solution ?

Here’s a few failing testcases:

1 
10000 10000 9000 9000
1 
10000 10000 10000 10000
1
2 6 3 4
2 Likes

Here’s a solution. The logic is that there should be a pair of pairs of sides that bear equal values each.

ok the last case
1
2 6 3 4
proves this approach is wrong
i was also thinking about such pair where there is chance of being perfect square not being equal ,thanks for the help
gotcha

1 Like