Count how many squares a rook, bishop, and king can attack from their starting positions on an chessboard.
You are given the coordinates of three chess pieces on a standard board: a rook, a bishop, and a king. For each piece, determine how many legal squares it can move to in one move, assuming the board is otherwise empty and pieces do not block one another.
Return the number of possible destination squares for each piece.
Three pairs of integers describing the positions of the rook, bishop, and king on an board.
Each coordinate is 1-indexed and lies in the range $1 to \8$.
Print three integers: the number of squares reachable in one move by the rook, bishop, and king, in that order.
Example 1
Input
1 1 4 4 8 8
Output
14 13 3
Explanation
Premium problem context
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.