Knapsack problem for CS 5050