There is a field x on y, two players, in turn, rearrange the queen from the lower left corner to the upper right one by n cells vertically, or horizontally, or d cells diagonally (right-up). The one who cannot make a move loses. Does the player who started the game have a winning strategy?
There are four variables: x and y - the sides of the field, n - cells move vertically or horizontally, d - cells diagonally (right-up).
I tried from the end, put down + -, but the field can be 100000 by 10000000 conditionally, some algorithm for solving the problem is needed.
If anyone has ideas or an algorithm, I would be very grateful for the help.
Is the Queen able to move any number of squares,
as is the case on a chessboard?
If so, your winning strategy would be to move first,
then just move her all the way to the other corner.