Why this solution is giving wa

solution :CodeChef: Practical coding for everyone
question link: CodeChef: Practical coding for everyone