← All problemsSign in

Four Equidistant Points on a Grid

CodeChefRating 1460Open on judge ↗

The *manhattan distance* between two points $P_1(x_1, y_1)$ and $P_2(x_2, y_2)$ is given by $d(P_1, P_2) = |x_2 - x_1| + |y_2 - y_1|$. In other words, *manhattan distance* is the minimum number of moves required to reach $P_2$ from $P_1$ if, in each move, you are allowed to travel one unit along the $X$-axis or one unit along the $Y$-axis. You are given an integer $D$. Find four points $(P_1, P_

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