Ladder ride problem DP

it is showing wrong answers bt i cant understand my mistakeplz help.
The link to my problem is
https://www.hackerearth.com/submission/25486270/