uncomment this code to print table
for ( int i = 0 ; i <= n ; i ++ ) { for ( int j = 0 ; j <= sum ; j ++ ) printf ( " % 4d " , subset [ i ] [ j ] ) ; printf ( " n " ) ; } return $ subset [ $ n ] [ $ sum ] ; }