Chef Adi
CodeChefOpen on judge ↗
Chef Adi is a master in Chess. To master his calculations, Adi placed a king on a chessboard. A chessboards has 8 rows and 8 columns. For this problem let the rows and columns be numbered from 1 to 8. Let’s denote the square in row r and column c by (r,c). A king on a square (r1,c1) can move to another square (r2,c2) if and only if (r2-r1)2 + (c2-c1)2 ≤ 2. Adi placed his king on the square (R,C
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