← All problemsSign in

Chocolates

Alice is teaching a class of N+1 students and she is planning a picnic for her students. Each of her students is given a distinct rank between 0 and N for identification which makes sure they don’t get lost during the picnic. She has brought with her many bags each completely filled with N2chocolates. She wants to distribute them among her students. But, like every other teacher, she is not going

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