Question 166
Let $n$ be a positive integer and let $a_1 \le a_2 \le \dots \le a_n$ and $b_1 \le b_2 \le \dots \le b_n$ be two nondecreasing sequences of real numbers such that
$$
a_1 + \dots + a_i \le b_1 + \dots + b_i \quad \text{for every } i = 1, \dots, n-1
$$
and
$$
a_1 + \dots + a_n = b_1 + \dots + b_n.
$$
Suppose that for any real number $m$, the number of pairs $(i, j)$ with $a_i - a_j = m$ equals the number of pairs $(k, \ell)$ with $b_k - b_\ell = m$. Prove that $a_i = b_i$ for $i = 1, \dots, n$.
**Note:** It is important to interpret the condition that for any real number $m$, the number of pairs $(i, j)$ with $a_i - a_j = m$ equals the number of pairs $(k, \ell)$ with $b_k - b_\ell = m$. It means that we have two identical multi-sets (a multi-set is a set that allows repeated elements)
$$
a_1 + \dots + a_i \le b_1 + \dots + b_i \quad \text{for every } i = 1, \dots, n-1
$$
and
$$
a_1 + \dots + a_n = b_1 + \dots + b_n.
$$
Suppose that for any real number $m$, the number of pairs $(i, j)$ with $a_i - a_j = m$ equals the number of pairs $(k, \ell)$ with $b_k - b_\ell = m$. Prove that $a_i = b_i$ for $i = 1, \dots, n$.
**Note:** It is important to interpret the condition that for any real number $m$, the number of pairs $(i, j)$ with $a_i - a_j = m$ equals the number of pairs $(k, \ell)$ with $b_k - b_\ell = m$. It means that we have two identical multi-sets (a multi-set is a set that allows repeated elements)