Math, asked by anjumbarbhuiya19381, 1 year ago

you have x no. of 5 rupee coins and y no. of 1 rupee coins. you want to purchase an item for amount z. the shopkeeper wants you to provide exact change. you want to pay using minimum number of coins. how many 5 rupee coins and 1 rupee coins will you use? if exact change is not possible then display -1


pinksblack: ans pls

Answers

Answered by niesh
0
I jjkhjhjkbbm motion
Answered by imhkp4u
0

There will be an optimal solution to this problem only in case the amount for the cost of item must be greater than 5. Only in that case instead of giving five one rupee coins we can give a single 5 rupee coin to maintain the pattern of minimum number of coins. Where is in case the cost of the item is 4 Rupees then we have to give 4 number of one rupee coins and no other optimise solution exist for this scenario.

Now the second case is in here the question is asked how many five rupee coin and one rupee coin will we use so that can only be predicted if we have the exact value for the price of the item. Therefore the number of coins will solely depend upon the value of Z.

("p" no.of 5 rupee coin + "q" no.of 1 rupee coin ≤ z).

Similar questions