Problem J
General Knight
For the uninitiated, chess is a board game is played on a
grid of
In chess, a piece threatens a square on the board
if the piece can move to that square in one move. The knight is
one of the more fearsome chess pieces, as it moves differently
from the other pieces. In a single move, a knight can move two
rows and one column or one column and two rows. The image below
shows the squares a standard chess knight threatens if it
starts in square
![\includegraphics[width=0.75\textwidth ]{knight_e5}](/problems/utipc19.generalknight/file/statement/en/img-0001.png)
The standard chess knight is a
Input
Input consists of two lines. The first line has two
space-separated integers
Output
First, output an integer
Sample Input 1 | Sample Output 1 |
---|---|
4 5 a1 |
2 e6 f5 |
Sample Input 2 | Sample Output 2 |
---|---|
2 1 e5 |
8 c4 c6 d3 d7 f3 f7 g4 g6 |