0 1 knapsack problem solved using dynamic programming