Change

Write a program that, given an amount of euros and cents, prints the minimal number of banknotes and coins needed to obtain that amount, knowing that there are coins of 1, 2, 5, 10, 20 and 50 cents and 1 and 2 euros, and banknotes of 5, 10, 20, 50, 100, 200 and 500 euros.

Input

Input is a real positive number with, at maximum, two decimals behind the comma.

Output

The output must indicate how many banknotes and coins of each type must be given to represent the amount of the input, being the number of banknotes and coins the minimum possible. Use the format of the examples.

Observation

Be careful with accuracy problems of real numbers!

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T10:08:42.879Z

© Jutge.org, 2006–2026.
https://jutge.org