#C4464. Minimum Coins Problem
Minimum Coins Problem
Minimum Coins Problem
You are given an integer n
which represents an amount in cents. Your task is to determine the minimum number of coins required to make up that amount using only the following coin denominations:
- Dime: 10 cents
- Nickel: 5 cents
- Penny: 1 cent
You should use the greedy approach, which works correctly for these canonical coin denominations. In mathematical terms, if n
is the amount, then the total number of coins used is given by:
Implement a program to solve this problem.
inputFormat
The input is given in stdin and consists of a single line containing an integer n
(0 ≤ n ≤ 106), which represents the amount in cents.
outputFormat
Output the minimum number of coins required to make the given amount. The output should be printed to stdout as a single integer.
## sample28
6