WA in CENS20G - Help

Q- https://www.codechef.com/CENS2020/problems/CENS20G

Help with test cases to check why it’s giving WA…

here is my code link-: https://www.codechef.com/viewsolution/37003373