Trace unbounded Knapsack with items and capacity . Unlike 0/1 Knapsack, we can reuse items. The DP is = max value with capacity . Process each capacity, trying all items. (one of item 1). (one of item 2). (two of item 1). (item 1 + item 2). (two of item 2). (item 1 + two of item 2).
Answer: . The key difference from 0/1: each item can contribute multiple times, so we don't track which items were used, just the capacity.