PALIN is getting NZEC even after running successfully with test cases on codechef IDE

You can see my solution here and i can assure you that it is running correct on every possible test case . https://www.codechef.com/viewsolution/22513924

//