The city of Linearville has $N$ parallel two-way streets going in the West-East direction and $N$ parallel two-way streets going in the South-North direction, making up a grid with $(N - 1) \times (N - 1)$ blocks. The distance between two consecutive parallel streets is either $1$ or $5$. The Linearville Transit Authority is conducting an experiment and now requires all cars to always follow a path that alternates direction between W-E and S-N at every crossing, meaning they must turn either left or right when reaching a crossing. The LTA is developing a new navigation app and needs your help to write a program to compute the lengths of shortest alternating paths between many pairs of start and target crossings. The alternating path in the figure, as an example for $N = 10$, is clearly not a shortest alternating path. But beware! Linearville may be huge.