DP-knapsack problem