Driver Code
static void Main ( ) { int n = 4 ; int [ , ] adj = new int [ , ] { { 5000 , 3000 } , { 6000 , 2000 } , { 8000 , 1000 } , { 9000 , 6000 } } ; for ( int i = 0 ; i < 100 ; i ++ ) for ( int j = 0 ; j < 100 ; j ++ ) dp [ i , j ] = - 1 ; Console . Write ( find ( 1 , 1 , n , adj ) + adj [ 0 , 1 ] + " STRNEWLINE " ) ; } }