Problem 173736 · medium · Phase 01 Prerequisites & Setup

Change Machine

input · integer division · modulo · print

A vending machine returns change using the fewest US coins: quarters (25 cents), dimes (10), nickels (5) and pennies (1). Read an amount in cents and print how many of each coin it hands back, one per line, largest coin first:

Quarters: <q>
Dimes: <d>
Nickels: <n>
Pennies: <p>

Examples

Input:  287
Output:
Quarters: 11
Dimes: 1
Nickels: 0
Pennies: 2

Constraints

  • 0 <= cents <= 10**6

Goals

  • Break an amount into coins from largest to smallest
  • Use // for how many and % for what remains, several times in a row
Starting Python…