I am solving [this] problem.
This is my solution :
 For every case I could make, it gives correct answer. But on submission I get wrong answer. Please help what's wrong in the code. For which cases does the code go wrong? : http://www.codechef.com/problems/A1 : http://www.codechef.com/viewsolution/3659472