I have a collection of cards. Each card has a cost and also a value. The higher the value, the better the card.

I want to make a hand of up to 9 cards from the collection.
I have to keep the total cost of my hand under 70.
How do I make the hand with the highest total value?

The numbers 9 and 70 are arbitrary but work for this sample collection (value,cost)

```
collection = [
    [390,13],
    [294,7],
    [393,7],
    [448,7],
    [235,9],
    [389,9],
    [306,7],
    [263,8],
    [231,9],
    [256,7],
    [396,9],
    [379,9],
    [306,10],
    [240,9],
    [259,4],
    [160,4],
    [225,4],
    [190,3],
    [141,3],
    [188,3],
    [190,4],
    [192,4],
    [192,3],
    [282,5],
    [192,4],
    [169,3],
    [253,4],
    [219,4],
    [240,5]
]

```

In knapsack terms

Maximize Sum(V[i]x[i]) i from 1 to n

Subject to Sum(W[i]x[i]) <= 70 i from 1 to n

and Sum(x[i]) <= 9 i from 1 to n

where x[i] is 0 or 1

V is the value of each card

W is the weight of each card