RR Stone CONSTRAINTS

Code perfectly works with all test cases like boundary cases, intermediate cases, time limits. But when it is submitted to code chef they are giving WA. Thinking over this and trying all the alternatives for the last 2 days, I am really really confused. And can’t stop thinking about those candidates who have submitted their answers and have got CA.
Its understandable that code chef don’t want to provide test cases but atleast they should mention how to handle the overflow in the differences ? Whether to move back to -'ve or discard higher terms ??

Any hint or suggestion however small it could be highly helpful.

Asking/Seeking hints for CodeChef’s live contest is against the conditions.

The problem is correct, you might have to think a little more.

All the best…!