The following problem and solution (Problem 7 - African Rally) is presented in "the Art of Mathematics" by Bela Bollobas:
Its solution is
I am fine until I get to the sentence that starts ...
and then I'm lost in trying to understand the use of the i and j indices. Any help...