Coin Change
CodeChefOpen on judge ↗
Chef went to his favourite bakery to buy some sweets. After picking up his favourite sweets his total bill was $P$ rupees. Chef lives in Chefland where all the money is in the form of coins. Now, Chef is not very good at maths and thinks more coins mean more money and he will be happy if he has the most possible money left with him. So, in short, he would like to pay with the minimum possible num
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start