← All problemsSign in

Candy Distribution

Nehal is a kindergarten teacher. She has a lot of candies and wants to give some of them to her students. All the N students sit in a line, and each of them must be given at least one candy. She wants to distribute the candies in such a way that the product of the number of candies any two adjacent kids have, is not greater than M. You will be given N and M, you have to find the number of ways N

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