← All problemsSign in

Distribute Money

There are $K$ students in a class. One day a professor named Dr. HeeHee gave them a problem stating that he has $M$ coins and want to distribute those among his $K$ students (not necessarily equally). So he asked one of his student HooHoo to tell number of ways for distributing coins. HooHoo found this problem easy to solve so Dr.HeeHee modified problem a little bit, he gave some constraints that

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