My code works for the given test cases but I get an NZEC in the codechef compiler. I believe the problem is not that simple as it looks however I do not understand where my code went wrong. Here is my code: http://www.codechef.com/viewsolution/2529208
Any help regarding how to fix this NZEC problem would be extremely helpful. Thank You.