← All problemsSign in

Ada Bishop

CodeChefRating 3096Open on judge ↗

Ada has the biggest chessboard in ChefLand. It has $N$ rows (numbered $1$ through $N$) and $M$ columns (numbered $1$ through $M$), where $M \ge 2N$. As training for her upcoming world chess championship match, she placed one bishop at row $r$ and column $c$ of her board. The remaining squares of the board are empty. Now, she is calculating the number of squares that can be reached by the bishop in

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