You edited your question to ask what is the best way to make changes for a given amount using a given set of coins; at least I think the question you are asking. I assume that there is an unlimited amount of each coin value, or at least enough so that you can use as many coins of each denomination as you want.
Take, for example, the problem of making changes to the dollar using coins of 1, 5, 10, and 25 cents; The dollar is 100 cents. The greedy algorithm always takes the largest coin possible. Thus, at the first stage, the largest coin is less than or equal to the specified amount, so add a coin by 25 cents to the output and reduce the target to 75 cents. In the second step, the largest coin is less than or equal to the reduced target, so add a 25 cents coin to the output and reduce the target to 50 cents. In the third step, the largest coin is less than or equal to the reduced target, so add a 25 cents coin to the exit and reduce the target to 25 cents. In the fourth step, the largest coin is less than or equal to the reduced target, so add a 25 cents coin and reduce the target to 0 cents. Now there is nothing to do, so the output is four coins in denominations of 25 cents.
Since it was not very interesting, try again with a goal of 47 cents. At the first stage, a coin with a value of 25 cents is displayed and reduced to 22 cents. Now it is no longer possible to issue a coin of 25 cents, so withdraw the largest coin, less than or equal to the reduced target, which is a coin of 10 cents, and reduce the target to 12 cents. In the third stage, the largest coin is less than or equal to the reduced target - 10 cents, so withdraw this coin and reduce the target to 2 cents. The next two steps will set the coin at 1 cent and reduce the target to zero. Thus, the output is one coin of 25 cents, two coins of 10 cents and two coins of 1 cents, for a total of 47 cents.
I will leave it to you to write the code from there. And, as you said, this has nothing to do with Euler 76.
UPDATE responds to the first comment that has now disappeared.
I'm not sure what to name your code. Perhaps greedy is a good enough word. Here is how I would do it, with debug output turned on so you can see the intermediate steps:
def greedy(amount, denoms): result = [] while (amount > 0): print amount, denoms, result if (amount >= denoms[0]): num = amount // denoms[0] amount -= (num * denoms[0]) result.append([denoms[0], num]) denoms = denoms[1:] return result print greedy(100, [25,10,5,1]) print "" print greedy(100, [10,5,1]) print "" print greedy(100, [5,1]) print "" print greedy(100, [1]) print "" print greedy(47, [25,10,5,1])
And the result:
100 [25, 10, 5, 1] [] [[25, 4]] 100 [10, 5, 1] [] [[10, 10]] 100 [5, 1] [] [[5, 20]] 100 [1] [] [[1, 100]] 47 [25, 10, 5, 1] [] 22 [10, 5, 1] [[25, 1]] 2 [5, 1] [[25, 1], [10, 2]] 2 [1] [[25, 1], [10, 2]] [[25, 1], [10, 2], [1, 2]]
Does it help?