← All problemsSign in

Dance Moves

This year Chef is participating in a Dancing competition. The dance performance will be done on a linear stage marked with integral positions. Initially, Chef is present at position $X$ and Chef's dance partner is at position $Y$. Chef can perform two kinds of dance moves. If Chef is currently at position $k$, Chef can: 1. Moonwalk to position $k+2$, or 2. Slide to position $k-1$ Chef wants to f

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