Three distinct numbers are given. The average of the average of the two smaller numbers and the average of the two larger numbers is equal to the average of all three numbers. The average of the smallest and the largest number is 2022.

Determine the sum of the three given numbers.

(K. Pazourek)

Hint. Express one of the numbers in terms of the remaining two.
Let's denote the three numbers from the problem as $a, b, c$, where $a<b<c$. The first condition means

$$
\frac{\frac{a+b}{2}+\frac{b+c}{2}}{2}=\frac{a+b+c}{3}
$$

We can simplify this equation as follows:

$$
\begin{aligned}
\frac{a+2 b+c}{4} & =\frac{a+b+c}{3}, \\
3 a+6 b+3 c & =4 a+4 b+4 c, \\
2 b & =a+c \\
b & =\frac{a+c}{2} .
\end{aligned}
$$

Thus, $b$ is the average of $a$ and $c$, and we know its value: $b=\frac{a+c}{2}=2022$.

From the given information, it follows that the sum of the numbers is

$$
a+b+c=b+2 b=6066 \text {. }
$$

Notes. From the given data, it is not possible to determine the numbers themselves, only their sum. The fact that the problem is meaningful, i.e., that there exist numbers with the given properties, can be demonstrated, for example, by the triplet $a=2020, b=2022, c=2024$.

At the very beginning, one can notice that if $b$ is the average of $a$ and $c$, then any such triplet of numbers satisfies the first condition from the problem: both the average of the averages $\frac{a+b}{2}$ and $\frac{b+c}{2}$, and the average of all three $\frac{a+b+c}{3}$, are equal to $b=\frac{a+c}{2}$. For conditions of the type $(*)-\mathrm{t} \text{i.e., linear with respect to } a, b, c-$, any of the numbers $a, b, c$ is uniquely determined by the other two. With this addition, the above observation can be considered a satisfactory substitute for the above transformations of the equality (*).