Highway Bypass -can someone please point out the mistake in my solution.

question : https://www.codechef.com/IOIPRAC/problems/INOI1401

dp state represents no. of ways to go to target given that next move will be 0(down) or 1(right) and the no. of moves left in that direction.

rleft : moves left in right direction

dleft : moves left in downwards direction

solution : https://ideone.com/GWwTzf