#K10646. Knight Moves on a 2x2 Chessboard
Knight Moves on a 2x2 Chessboard
Knight Moves on a 2x2 Chessboard
You are given a chessboard of size 2 \(\times\) 2 and a knight placed on one of the cells. In chess, a knight moves in an \(L\)-shaped pattern, i.e., two steps in one direction and one step perpendicular to it. However, on a 2x2 board, any standard knight move will move it outside the board bounds.
Your task is to compute the number of valid knight moves from the given starting positions. Since no valid knight move exists on such a small board, the answer will always be 0
for every test case.
Input Format: The first line contains an integer \(T\) representing the number of test cases. Each of the next \(T\) lines contains two integers \(x\) and \(y\) indicating the starting position on the chessboard.
Output Format: For each test case, output a single line containing the number 0
because no valid move exists.
inputFormat
Input is read from stdin and follows the format:
T x1 y1 x2 y2 ... (T lines in total)
Where:
- T is an integer representing the number of test cases.
- x, y are integers representing the knight's initial position on the 2x2 chessboard.
outputFormat
Output the result to stdout with each test case's answer on a new line. Since the knight cannot move within a 2x2 board, the output for every test case is 0
.
4
1 1
1 2
2 1
2 2
0
0
0
0
</p>