← All problemsSign in

Two Rooks

CodeChefRating 957Open on judge ↗

You are given a standard $8 \times 8$ chessboard which has exactly $2$ rooks on it and no other pieces. The rows are numbered $1$ to $8$ from bottom to top, and the columns are numbered $1$ to $8$ from left to right. The cell at the intersection of the $i$-th column and $j$-th row is denoted $(i,j)$. Given the initial positions of the rooks in the form of coordinates $(X_1,Y_1)$ and $(X_2,Y_2)$,

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