I've got a following problem:
There is a set of items, every item has 2 different positive values A and B.
The knapsack has two values: totalA and totalB. which are the maximum sums of values A and B of chosen items.
I have to find out, what the maximum items count the knapsack can hold is.
Example:
Input:
totalA: 10, totalB: 15
item1 A:3, B: 4
item2 A:7, B: 2
item3 A:1, B: 9
item4 A:2, B: 1
item5 A:4, B: 6
Output:
3(items: 2, 3, 4)
How should I use dynamic programming in order to solve this task?