Can anyone please help as to why my code is showing WA

Question link: https://www.codechef.com/LRNDSA03/problems/EXUNC
Submission link: https://www.codechef.com/viewsolution/35722046
The solution is partially correct…But all the test cases do not pass!.Please help!.