Diwali and Chocolate
CodeChefOpen on judge ↗
It's Diwali season and you and your brother have received $N$ chocolate bars from your relatives. Now you and your brother want to divide the chocolate amongst yourselves. Being elder it's your responsibility to cut the bars into multiple pieces ($K$ at most). Your brother will take the largest amongst all the pieces, now you need to divide the bars such that he receives the smallest possible bar.
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