Input and output are correct but the chef gives a wrong answer

here is my code, i have perfect input and output then why am i getting a wrong answer?
https://www.codechef.com/viewsolution/39955660