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 [ ] : dp ) Arrays . fill ( i , - 1 ) ;