knapsack problem decoder