Every test case I try is correct but it shows "Wrong Answer"!
I compared all test cases with my first program which runs perfectly but exceeds the time limit.
Here is my solution : http://ideone.com/9pQgTA
Can anyone tell me why it is wrong?
Try this test case:
22 22 -1 -1