python knapsack solver