Driver Code
public static void Main ( String [ ] args ) { int n = 5 ; int [ ] a = { 1 , 5 , 4 , 3 , 2 } ; int k = 1 ; int m = 4 ; int [ , ] dp = new int [ n + 1 , k + 1 ] ; for ( int i = 0 ; i <= n ; i ++ ) for ( int j = 0 ; j <= k ; j ++ ) dp [ i , j ] = - 1 ;