기출 문제 / ACPC 2025 ACPC

Short on Coins

Cody, the owner of a mart, lets out a weary breath once again today. Every time he gives change, he ends up overusing certain types of coins, causing a pileup of other coins while the frequently used coins are always in short supply. When Cody gives change of amount M, he wants to use a balanced mix of different types of coins as much as possible.