Driver code
static void Main ( ) { int R = 40 , B = 10 , W = 4 ; int [ , , ] dp = new int [ RUNMAX , BALLMAX , WICKETMAX ] ; for ( int i = 0 ; i < RUNMAX ; i ++ ) for ( int j = 0 ; j < BALLMAX ; j ++ ) for ( int k = 0 ; k < WICKETMAX ; k ++ ) dp [ i , j , k ] = - 1 ; Console . WriteLine ( CountWays ( 0 , 0 , 0 , R , B , W , dp ) ) ; } }