Blackhawk Network Interview Question

One DP problem can be solved by unbounded knapsack, just need to tweak a bit.