Kind Uncle Ben
CodeChefOpen on judge ↗
Uncle Ben is a very kind man and is revered by the whole neighborhood. One halloween night a group of trick-or-treaters come by Ben's house. Uncle Ben has some treats with him but he sees that the children do not have equal number of treats. He feels that it would be unfair to give away the treats to just any of the kids. So he decides to line up all the kids and distribute the treats according to
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