← All problemsSign in

Drawing Lines

CodeChefRating 2526Open on judge ↗

There is an infinite sheet of paper and a pen. At any time, the pen may be placed above a point $(x, y)$ on the paper or touching it at a point $(x, y)$; in both cases, we call the point $(x, y)$ the *position* of the pen. The initial position of the pen is $(0, 0)$. You may perform the following types of actions: - move the pen down until it touches the paper - lift the pen (if it was touching 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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start