Condition to check that the movement with the current value is not possible
if ( val > v [ ( int ) i ] [ ( int ) j ] ) { return dp [ ( int ) i , ( int ) j ] = MAX ; } long temp = v [ ( int ) i ] [ ( int ) j ] - val ;