BlueBook - Change

View as PDF

Submit solution

Points: 3
Time limit: 0.2s
Memory limit: 16M

Problem types

Write a program that makes change for amounts less than one dollar with the least number of coins.

Input Specification

Input will be a positive integer less than 100, representing an amount of money in cents.

Output Specification

Output should be the original amount of money together with a minimal set of coins (quarters, dimes, nickels, cents) that could make up that amount.

Sample Input


Sample Output

58 cents requires 2 quarters, 1 nickel, 3 cents.


58 cents requires 2 quarters, 0 dimes, 1 nickels, 3 cents.

will not be accepted.


  • 4
    fireheartjerry  commented on Jan. 21, 2023, 3:21 a.m.

    When N = 1 note that the output should be 1 CENT requires 1 cent, instead of 1 CENTS... (without the all caps)