Number of ways for reaching cell (a,b) in a grid of size NxM.

51 Views Asked by At

An $N\times M$ grid is given, in one operation, we have to move to any diagonal adjacent cell. For example, if we are on cell $(3,3)$, in one opeartion we can move to any of $(2,4), (4,2), (2,2)$ and $(4,4)$ cells. Starting from $(1,1)$ cell, how to find the number of ways of reaching $(a,b)$ cell after $C$ number of operations.