There are 2022 equally spaced points on a circular track $\gamma$ of circumference 2022. The points are labeled $A_{1}, A_{2}, \ldots, A_{2022}$ in some order, each label used once. Initially, Bunbun the Bunny begins at $A_{1}$. She hops along $\gamma$ from $A_{1}$ to $A_{2}$, then from $A_{2}$ to $A_{3}$, until she reaches $A_{2022}$, after which she hops back to $A_{1}$. When hopping from $P$ to $Q$, she always hops along the shorter of the two arcs $\overparen{P Q}$ of $\gamma$; if $\overline{P Q}$ is a diameter of $\gamma$, she moves along either semicircle.

Determine the maximal possible sum of the lengths of the 2022 arcs which Bunbun traveled, over all possible labellings of the 2022 points.
Replacing 2022 with $2 n$, the answer is $2 n^{2}-2 n+2$. (When $n=1011$, the number is 2042222.)
₪ Construction. The construction for $n=5$ shown on the left half of the figure easily generalizes for all $n$.
Remark. The validity of this construction can also be seen from the below proof.
First proof of bound. Let $d_{i}$ be the shorter distance from $A_{2 i-1}$ to $A_{2 i+1}$.
Claim - The distance of the leg of the journey $A_{2 i-1} \rightarrow A_{2 i} \rightarrow A_{2 i+1}$ is at most $2 n-d_{i}$.

Proof. Of the two arcs from $A_{2 i-1}$ to $A_{2 i+1}$, Bunbun will travel either $d_{i}$ or $2 n-d_{i}$. One of those arcs contains $A_{2 i}$ along the way. So we get a bound of $\max \left(d_{i}, 2 n-d_{i}\right)=2 n-d_{i}$.

That means the total distance is at most
$$
\sum_{i=1}^{n}\left(2 n-d_{i}\right)=2 n^{2}-\left(d_{1}+d_{2}+\cdots+d_{n}\right) .
$$

Claim - We have
$$
d_{1}+d_{2}+\cdots+d_{n} \geq 2 n-2 .
$$

Proof. The left-hand side is the sum of the walk $A_{1} \rightarrow A_{3} \rightarrow \cdots \rightarrow A_{2 n-1} \rightarrow A_{1}$. Among the $n$ points here, two of them must have distance at least $n-1$ apart; the other $d_{i}$ 's contribute at least 1 each. So the bound is $(n-1)+(n-1) \cdot 1=2 n-2$.

T Second proof of bound. Draw the $n$ diameters through the $2 n$ arc midpoints, as shown on the right half of the figure for $n=5$ in red.
Claim (Interpretation of distances) - The distance between any two points equals the number of diameters crossed to travel between the points.

Proof. Clear.
With this in mind, call a diameter critical if it is crossed by all $2 n$ arcs.
Claim - At most one diameter is critical.

Proof. Suppose there were two critical diameters; these divide the circle into four arcs. Then all $2 n$ arcs cross both diameters, and so travel between opposite arcs. But this means that points in two of the four arcs are never accessed - contradiction.
Claim - Every diameter is crossed an even number of times.

Proof. Clear: the diameter needs to be crossed an even number of times for the loop to return to its origin.

This immediately implies that the maximum possible total distance is achieved when one diameter is crossed all $2 n$ times, and every other diameter is crossed $2 n-2$ times, for a total distance of at most
$$
n \cdot(2 n-2)+2=2 n^{2}-2 n+2 \text {. }
$$