Along with the black knight, a white queen is now introduced to the chessboard at a random position (a, b) (x, y). Determine any legitimate path that the knight must take to reach any of the squares on the chessboard’s topmost row.
• The black knight and white queen cannot be placed on the same square; if they are, the user will be notified; and the black knight cannot move to the squares or be placed in one that is already guarded by the white queen.
• The white queen cannot be put on the board’s uppermost row; if it is, the user will be notified.