← All problemsSign in

Chocolate Distribution

CodeChefRating 1104Open on judge ↗

Chef has a total of $N$ $(N\geq 4)$ chocolates. He decided to distribute them into **three** jars such that: - **At least one** jar has **odd** number of chocolates; - **Exactly two** jars have **same** number of chocolates; - Every jar has at least one chocolate. Find a valid distribution of chocolates for Chef. Note that a valid distribution always exists. If multiple such distributions exist,

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