Question 4
Let $n \ge 2$ be an integer and $(a_1, a_2, \dots, a_n)$ be a permutation of $1, 2, \dots, n$. For each $1 \le k \le n$, $a_k$ apples are placed at the point $k$ on the real axis. Children named $A, B, C$ are assigned points $x_A, x_B, x_C \in \{1, 2, \dots, n\}$, respectively. For each $k \in \{1, 2, \dots, n\}$, children whose points are closest to $k$ divide $a_k$ apples equally among themselves. We call $(x_A, x_B, x_C)$ a *stable configuration* if no child's total share can be increased by assigning a new point to this child and not changing the points of the other two. Determine the values of $n$ for which a stable configuration exists for some distribution $(a_1, a_2, \dots, a_n)$ of the apples.