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 $\operatorname{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.) ![](https://cdn.mathpix.com/cropped/2024_11_19_5c8ecd58885c530bab97g-03.jpg?height=402&width=899&top_left_y=1202&top_left_x=586)  【 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}$. 

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 $$