A simple knapsack solver