Unbounded knapsack problem