The sum part (capturing) is easy: Just be greedy and capture everything you can.<p>The multiplication part (x bonus) looks hard. You want the minimal product of bonus. It feels like the <a href="https://en.wikipedia.org/wiki/Knapsack_problem" rel="nofollow">https://en.wikipedia.org/wiki/Knapsack_problem</a> but I'm not sure.