← All problemsSign in

Too Much Sweetness

CodeChefRating 2374Open on judge ↗

Raghav studies in NSIT and is bored of the regular hostel mess food. For a change he went to a sweet shop at City Centre near the college to have some sweets. There he found only two boxes containing sweets; box 1 contains p sweets and box 2 contains q sweets. Initially, both boxes are closed. Raghav wants to eat exactly N sweets in total during the following process: - Choose an index i (1 ≤ i

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