https://www.codechef.com/submit/WALK

https://www.codechef.com/submit/WALK
why i am getting WA

The link you posted does not have your code. Please link your code.
You can also refer to my solution:
https://www.codechef.com/viewsolution/34709825

thanks for help