The last cracker
CodeChefOpen on judge ↗
Ram has N different crackers. These crackers are very special, each of them can fire infinite number of fire-balls. Ram made an arrangement with those N crackers. If the spark is currently with the i'th cracker, it will first fire a fire-ball, and then it will pass the spark to the (i+1)'th cracker. Note that the N'th cracker will pass spark to the 1'st cracker. Ram initially placed the spark at 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