Problem #474
✰ - click to bookmark
★ - in your bookmarks
Tags:
unlabeled
Thanks to Mathias Kern for creating this puzzle!
You have an indefinite supply of coins with values 1, 5, 10, 50 and 100. How many different total values can you achieve if you add
exactly k coins together?
For k=1, the answer is obviously 5. For k=2, there are 15 different total amounts:
2, 6, 10, 11, 15, 20, 51, 55, 60, 100, 101, 105, 110, 150, 200
We will ask for much larger number of coins.
Input/Output: The first line of the input will contain a single integer n, the number of test cases. Each of the following n lines will
contain a single integer k - the exact number of coins. Provide your answers on a single line, with answers separated by spaces.
Example:
input:
2
1
2
answer:
5 15