Solution (source code)

= Solution

If a player chooses site $x$, the opponent can co-locate and hold its <payoff> to $k$. Among opposing sites to its right, the lowest <payoff> is obtained against $x+1$, giving $2x$. Among opposing sites to its left, the lowest is against $x-1$, giving $2(k-x+1)$. Thus the pure-action <security level payoff> is
$$
g(x)=\min\{k,\,2x,\,2(k-x+1)\}.
$$
The expression remains valid at an endpoint, where the missing-side term is redundant. It reaches its largest possible value $k$ exactly when $k/2\leq x\leq k/2+1$. Hence the pure maxmin <strategies> are
$$
\boxed{\begin{cases}x=(k+1)/2,&k\text{ odd},\\x\in\{k/2,k/2+1\},&k\text{ even},\end{cases}\qquad\text{with guaranteed payoff }k.}
$$
Reflection gives the same answer for the other player.