Driver Code
int main ( ) { int a [ ] = { 4 , 5 , 3 , 7 , 8 , 10 , 9 , 8 } ; int n = sizeof ( a ) / sizeof ( a [ 0 ] ) ; int k = 4 ; int dp [ n ] [ MAX ] ; memset ( dp , -1 , sizeof dp ) ; cout << recur ( 0 , 0 , 0 , a , n , k , dp ) ; }