z-knight
While Mr. Little Z. was playing chess with his firend, Isidora was secretly looking at him. She doesn't know how to play chess, so he asked Mr. Little Z. to teach her. Little Z was patiently teaching her how do the pieces move. First he taught her how Kings move, then Pawns, and finally the next piece on the list was the Knight.
• The Knight moves as described on the figure below (if S is the position of the knight it can move to the positions marked with x.
• The Knight can move only within the borders of the table (it can not jump outside the table) and also, it can only move to the fields that are not occupied with some other piece (of the same player).
We represent a chess board as a 8x8 square fields. The fields are named as on the figure above. On the figure above the Knight is on the field d4. On the board we will have one King, one Knight and 0-8 Pawns. All the pieces will be of the same color (belonging to the same player). Help Isidora to figure out to which fields she can move the Knight
e8 a4 a7 b7 c7 e7 d7Output:
b6 c5 c3 b2The Knight is on the field a4.
f7 h8 g6Output:
IMPOSSIBLEThe Knight is on the field h8.
Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.