I take the main diagonal to mean the diagonal from $(0,n)$ to $(n,0)$. We know that it takes exactly $n$ steps until the particle is at a position $(i,n-i)$ $0\leq i\leq n$. This is because after $k\leq n^2$ steps the particle must be at a position $(j,k-j)$ for $0\leq j\leq k$ since each step increases the first coordinate position by one or the second coordinate position by one but not both.
alext87
- 3.2k
- 1
- 23
- 42