Chef and Stacks
CodeChefOpen on judge ↗
It is Chef's birthday and he has received N coins from various well-wishers. All the coins are identical. To count the number of coins, Chef starts making stacks of coins. The first stack he makes has one coin, and all other stacks have one coin more than the previous stack. He continues this until he runs out of coins. As a result, only the last stack may have number of coins less than or equal t
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