Overall Aim
Find the lowest possible amount of money to add to a top-up card so the balance on the card can be completely used up. Mathematically, it's sort of similar to this.
Knowns
Starting Number - the amount of money left on the card.
Set of Prices - The set of individual prices that can be deducted from the card.
Minimum Top-Up - The minimum amount you can add to your card.
The minimum increment - you can only top up in 25p increments (e.g. £5.25 not £5.10)
Background
I live in an apartment complex. There is a laundry that everyone has to use, managed by a company called Circuit. They have an extremely complicated top-up system and make thousands of pounds every year from people who move out, leaving a small amount of money on their card. I want to make an algorithm that can tell you exactly how much to add to your card to completely zero it.
The algorithm I have written can do that, but only for one 'item'. It will tell you to add enough to buy 8 low-quality washes, for example, where it might be possible to add less to buy 3 medium-quality washes and 2 drys.
I should perhaps add that this is mainly an academic exercise; for fun.
You can see my tentative implementation in C++ here: https://github.com/SilverSkyes/F__kYouCircuit/blob/master/F__kYouCircuit/main.cpp