← All problemsSign in

Road To The Shop

Jethalal wants to reach his shop as soon as possible. After much effort, he gets an autorickshaw but the rickshaw is defective and works in a very weird way. Imagine a large infinite matrix with $(0, 0)$ being where Jethalal currently is and wants to reach his shop at $(x, y)$. The rickshaw will make **exactly** $N$ stops after Jethalal sits in it and between $(i-1)^{th}$ stop and $i^{t}$h stop i

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