Chef and the Cake I - WA

I’ve tried my best to find out all the edge cases for my approach but still i am getting error?
could you help me to find my edge cases.

Here’s my submission
https://www.codechef.com/viewsolution/95384409

Could you give me some tips to find out edge cases?

Run a test case

2
1 1 20 20
11 11 30 30
11 11 30 30
1 1 20 20

It fails there
Also, it will be very tedious to solve this question in this way. See

https://www.codechef.com/viewsolution/93598230