PLS HELP! IN B - Jumping Monkey

MY CODE IS GIVING WA IN THIS
https://www.codechef.com/viewsolution/36045835