Knapsack Problem Dynamic Method