knapsack, a bit too slow