acmsguru |
---|
Finished |
No solution.(without quotes). Otherwise, write to the first line of the output file message
There is solution:, and then to every of the N following lines write N numbers separated by spaces — order of traversal of the board. Each of the numbers from 1 to N2 should occur in this sequence exactly once. Knight may start and end its trip at any cell of the chessboard.
sample input | sample output |
3 | No solution. |
sample input | sample output |
5 | There is solution: 1 14 9 20 3 24 19 2 15 10 13 8 25 4 21 18 23 6 11 16 7 12 17 22 5 |
Name |
---|