← All problemsSign in

Donation

Bill is a billionaire but very down-to-earth. He finds peace in donating gold coins to charities. He always liked the gold coins he had and used to number them with integers. One day he decided to donate $N$ coins (coins numbered $1$ to $N$) to $C$ charities in the country. But Bill is a very moody person, some day he orders that each charity must receive at least one coin, sometimes he says at le

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start