← All problemsSign in

Winner Winner Cupcake Dinner

Its dinner time and cupcakes are on the menu. L and Light are at the dinner table. To make things interesting, L challenges Light to a fun game. The cupcakes are labelled $1$ to $N$ and are in a circle on the round table. The game is played in alternate turns. The game starts at the $K^{th}$ cupcake, here $K$ is decide by L. At any turn, the player picks the cupcake and eats it. Now the next playe

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