WA in ISHVALA

I don’t understand why my code is showing wrong answer, i ran it for many test cases and it runs fine. https://www.codechef.com/viewsolution/29281670