Driver code
public static void main ( String [ ] args ) { 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 ; System . out . println ( CountWays ( 0 , 0 , 0 , R , B , W , dp ) ) ; } }