knapsack example (update)