Snacks
CodeChefOpen on judge ↗
It is snacks time for Ahmed. His friend, Ali, prepared him a nice game for lunch. Ali brought Ahmed $n$ ordered piles of snacks such that $i$-th pile contains $a_i$ snacks. He labeled all these snacks with consecutive integers: snacks in first pile are labeled with numbers 1 to $a_1$, snacks in second pile are labeled with numbers $a_1 + 1$ to $a_1 + a_2$ and so on. See the example for a better un
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