Driver Code
int main ( ) { int a [ ] = { 10 , 30 , 40 , 50 , 20 } ; int k = 3 ; int n = sizeof ( a ) / sizeof ( a [ 0 ] ) ; int dp [ n ] ; memset ( dp , -1 , sizeof dp ) ; cout << FindMinimumCost ( 0 , a , n , k , dp ) ; return 0 ; }