Question 87
Let $n \ge 3$ be a fixed positive integer. There are $n$ boxes $A_1, A_2, \dots, A_n$, each with a number of stones in it $(a_1, a_2, \dots, a_n)$ such that $a_1+a_2+\cdots+a_n = 3n$. A move consists of the following operations:
choose a box and distribute all the stones in the box among the $n$ boxes (including the box that was chosen) such that for every two boxes the numbers of stones added to those boxes differ by at most 1.
For a distribution $a_1, a_2, \dots, a_n$, we define $f(a_1, a_2, \dots, a_n)$ as the least number of moves required to get all the stones into a single box. Let $M_n$ be the maximum of $f(a_1, a_2, \dots, a_n)$ for all possible distributions $a_1, a_2, \dots, a_n$ such that $a_1 + a_2 + \cdots + a_n = 3n$. Determine $M_n$ and all distributions $a_1, a_2, \dots, a_n$ for which $f(a_1, a_2, \dots, a_n) = M_n$.
*Example.* If $n = 4$ and the boxes contain 2, 6, 0, 4 stones in that order, then we can distribute the 2 stones from box $A_1$ by putting in each box in order 1, 0, 1, 0 stones. After this move, the number of stones in each box in order is 1, 6, 1, 4.
choose a box and distribute all the stones in the box among the $n$ boxes (including the box that was chosen) such that for every two boxes the numbers of stones added to those boxes differ by at most 1.
For a distribution $a_1, a_2, \dots, a_n$, we define $f(a_1, a_2, \dots, a_n)$ as the least number of moves required to get all the stones into a single box. Let $M_n$ be the maximum of $f(a_1, a_2, \dots, a_n)$ for all possible distributions $a_1, a_2, \dots, a_n$ such that $a_1 + a_2 + \cdots + a_n = 3n$. Determine $M_n$ and all distributions $a_1, a_2, \dots, a_n$ for which $f(a_1, a_2, \dots, a_n) = M_n$.
*Example.* If $n = 4$ and the boxes contain 2, 6, 0, 4 stones in that order, then we can distribute the 2 stones from box $A_1$ by putting in each box in order 1, 0, 1, 0 stones. After this move, the number of stones in each box in order is 1, 6, 1, 4.