Knapsack, a bit complicated but very nice problem!