Black Box
CodeChefOpen on judge ↗
In Black Box event, Kiran is standing in a line at coordinates $(X,0)$ and she wants to go to coordinates $(Y,0)$. In each step, she can either move to coordinates $(X-1,0)$ or $(X+1,0)$. However, her friend Himanshi being very caring, gives her a spell by using which she can either teleport to coordinates $(2*X,0)$ or $(3*X,0)$. Kiran has an infinite supply of spells but using spell cost her one
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