Let there be a chessboard of size , and only one bishop in a cell . How many cells can the bishop can attack in one move? You can assume that one possible move is staying in the current position.
In the first line of input, there will be a number () denoting the number of test cases.
On the next lines, there will be four integers , , , as described above. Here () is the number of columns and () is the number of rows. The bishop is at column (), row ().
For each test case print a single line with the number of cells the bishop can attack with one move.
Input | Output |
---|---|
2 8 6 2 4 8 6 1 1 | 8 6 |
The image above is a visualization of the first case.