First add all item prices. Then compare the total with the payment. Count the returned pieces and check item total + change = payment. A correct amount can use different sets of available pieces; the most pieces are not automatically the most value.
Worked example
A 47-cent item paid with 100 cents needs 53 cents back, as shown. For two items, add their prices before using the same check.
Paper Shop Receipt
A card costs 45 cents and a paper pack costs 80 cents. One of each is bought. The customer pays 200 cents. No tax, fees or discounts are included in these invented prices. The drawer has enough 25c, 10c, 5c and 1c pieces.