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

Question link: CodeChef: Practical coding for everyone
Submission link: CodeChef: Practical coding for everyone
The solution is partially correct…But all the test cases do not pass!.Please help!.