So, on this online game, there's this currency system where you want to break down these large coins into smaller denominations because of their desirability, but you can only do so by purchasing these items. You are allowed to combine small coins into larger coins, but they can only be done in exact amounts.
The coin system follows as {1, 2, 5, 10, 20, 50, 100, 200, 500, and 1,000}
The cheapest items that can be purchased to break down the coins are {3, 4, 5, and 6}
The most desirable coin denomination is the Five coin, then the Two coin, and lastly the One coin.
I was thinking if I started with a Ten coin, then I would have 10 - 3 = 7 or (5+2).
EDIT: I got this process wrong, and should have mentioned that the returned change is in the largest denominations, and you cannot ask for certain amounts of a specified coin.
If I expanded that to a One Hundred coin then I would something like 100 - 30 (3 items * 10) = 70 or (10 Five coins and 10 Two Coins).
Combining the 10 Two coins would give me a Twenty coin, so 20 - 6 (3 items * 2) = 14 (Two x2 Five x2) giving me a total of 12 Five Coins and 2 Two coins.
EDIT 2: 100 Coin = {50, 20, 20, 5, 2}
50 = {20, 20, 5, 2} // Total: {20, 20, 20, 20, 5, 5, 2}
20 = {10, 5, 2}
20 = {10, 5, 2}
20 = {10, 5, 2}
20 = {10, 5, 2} // Total: {10, 10, 10, 10, 5 (x6), 2 (x6)}
10 = {5, 2}
10 = {5, 2}
10 = {5, 2}
10 = {5, 2} // Total: {5 (x10), 2 (x10)}
2(x10) = 20
20 = {10, 5, 2} // Total: {5 (x11), 2}
10 = {5, 2} // Total: {5 (x12), 2, 2}
Oh, I ended up getting the same thing...
My questions are:
What would be the most efficient process to obtain the maximum of One, Two, and Five coins as possible from the larger coin amounts?
Can a formula be derived from this?