Here we have 4 types of coins, 1 2 5 and 10 value coins, you can make any value you want out of different combination of coins...
The combination with the maximum number of coins for value A is obviously A coins (all 1's)
The combination with the minimum number of coins for value A is floor(A/10)+floor((a%10)/5)+floor((a%5)/2)+(a%5)%2 (as in first you start with 10's, then a 5, then one or two 2's then a 1)
We want values that you can make them out of combination of all possible coin numbers from the min to the max, for example value 7 you can make it:
7 Coins: 1 1 1 1 1 1 1 (MAX)
6 Coins: 1 1 1 1 1 2
5 Coins: 1 1 1 2 2
4 Coins: 1 2 2 2
3 Coins: 5 1 1
2 Coins: 5 2 (MIN)
But for instance for value 15, the min is 2 and the max is 15 but you can't make it out of a 4 coin combo.
1. Find the smallest value that is larger than 20 that meets our requirement...
2. What is a general representation of the numbers that meet the requirements...
Question
Guest
Here we have 4 types of coins, 1 2 5 and 10 value coins, you can make any value you want out of different combination of coins...
The combination with the maximum number of coins for value A is obviously A coins (all 1's)
The combination with the minimum number of coins for value A is floor(A/10)+floor((a%10)/5)+floor((a%5)/2)+(a%5)%2 (as in first you start with 10's, then a 5, then one or two 2's then a 1)
We want values that you can make them out of combination of all possible coin numbers from the min to the max, for example value 7 you can make it:
7 Coins: 1 1 1 1 1 1 1 (MAX)
6 Coins: 1 1 1 1 1 2
5 Coins: 1 1 1 2 2
4 Coins: 1 2 2 2
3 Coins: 5 1 1
2 Coins: 5 2 (MIN)
But for instance for value 15, the min is 2 and the max is 15 but you can't make it out of a 4 coin combo.
1. Find the smallest value that is larger than 20 that meets our requirement...
2. What is a general representation of the numbers that meet the requirements...
Link to comment
Share on other sites
7 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.