Question 57
Some cities of country Graphland are connected with roads provided that
* (i) from each city we can reach any other city.
It turned out that every city $A$ can choose its favourite number $1 \le f(A) \le 2024$ which is an integer, such that the following condition holds:
* (ii) the favourite numbers of any two cities connected with a road are different.
Let $1 \le m \le 2024$ be a given integer. A tourist arrives in the capital of Graphland. He can move from city $A$ to city $B$ (in this direction), if and only if there is a road connecting $A$ and $B$ and additionally
$$
f(B) - f(A) \equiv m \pmod{2024}.
$$
For which values of $m$ it is guaranteed (no matter of the cities and roads, provided that (i) and (ii) hold) that the cities can choose their favourite numbers (complying with (ii)) in a way that the tourist can reach any city starting from the capital?
(Dragomir Grozev)
* (i) from each city we can reach any other city.
It turned out that every city $A$ can choose its favourite number $1 \le f(A) \le 2024$ which is an integer, such that the following condition holds:
* (ii) the favourite numbers of any two cities connected with a road are different.
Let $1 \le m \le 2024$ be a given integer. A tourist arrives in the capital of Graphland. He can move from city $A$ to city $B$ (in this direction), if and only if there is a road connecting $A$ and $B$ and additionally
$$
f(B) - f(A) \equiv m \pmod{2024}.
$$
For which values of $m$ it is guaranteed (no matter of the cities and roads, provided that (i) and (ii) hold) that the cities can choose their favourite numbers (complying with (ii)) in a way that the tourist can reach any city starting from the capital?
(Dragomir Grozev)