I think the judge's input cases are not dealing with some situations where the area of the larger cake is greater than half the cake size.
I wrote a wrong solution initially and got it AC. Later , realised that my previous solution was wrong.
For example
Code: Select all
10 1
0 9 10 9
0 9 10 0
Code: Select all
75.71 2.40
Code: Select all
277.68 2.40