## Task 1.

To each vertex of a regular $n$-gon, a non-negative real number is assigned such that the sum of all assigned numbers is 1. Let $A$ be the sum of the products of the numbers assigned to every three consecutive vertices. Determine the maximum possible value of $A$ and find all cases in which this value is achieved if
a) $n=4$,
b) $n=6$.
## Solution.

Let $x_{1}, \ldots, x_{n}$ be non-negative real numbers assigned to the vertices of an $n$-gon in order.

In part a) of the problem, we have the sum $A=x_{1} x_{2} x_{3}+x_{2} x_{3} x_{4}+x_{3} x_{4} x_{1}+x_{4} x_{1} x_{2}$. If we rewrite this sum in a different way and apply the inequality $a b \leqslant \frac{1}{4}(a+b)^{2}$, we get:

$$
\begin{aligned}
A & =x_{1} x_{2}\left(x_{3}+x_{4}\right)+x_{3} x_{4}\left(x_{1}+x_{2}\right) \\
& \leqslant \frac{1}{4}\left(x_{1}+x_{2}\right)^{2}\left(x_{3}+x_{4}\right)+\frac{1}{4}\left(x_{3}+x_{4}\right)^{2}\left(x_{1}+x_{2}\right) \\
& =\frac{1}{4}\left(x_{1}+x_{2}+x_{3}+x_{4}\right)\left(x_{1}+x_{2}\right)\left(x_{3}+x_{4}\right) \\
& \leqslant \frac{1}{4}\left(x_{1}+x_{2}+x_{3}+x_{4}\right) \cdot \frac{1}{4}\left(\left(x_{1}+x_{2}\right)+\left(x_{3}+x_{4}\right)\right)^{2} \\
& =\frac{1}{16}\left(x_{1}+x_{2}+x_{3}+x_{4}\right)^{3}=\frac{1}{16}
\end{aligned}
$$

Equality is achieved if and only if the factors are equal for each application of the inequality:

$$
x_{1}=x_{2}, \quad x_{3}=x_{4}, \quad x_{1}+x_{2}=x_{3}+x_{4}
$$

from which it follows that all numbers $x_{1}, x_{2}, x_{3}$, and $x_{4}$ are equal to $\frac{1}{4}$. Therefore, the maximum value of the number $A$ is $\frac{1}{16}$ and is achieved only in this case.

In part b) of the problem, we have the sum

$$
A=x_{1} x_{2} x_{3}+x_{2} x_{3} x_{4}+x_{3} x_{4} x_{5}+x_{4} x_{5} x_{6}+x_{5} x_{6} x_{1}+x_{6} x_{1} x_{2}
$$

which we can also rewrite as:

$$
A=\left(x_{1}+x_{4}\right)\left(x_{2}+x_{5}\right)\left(x_{3}+x_{6}\right)-x_{1} x_{3} x_{5}-x_{2} x_{4} x_{6}
$$

The last two terms are non-negative, and for the first term, we use the inequality between the geometric and arithmetic means. We get

$$
A \leqslant\left(\frac{\left(x_{1}+x_{4}\right)+\left(x_{2}+x_{5}\right)+\left(x_{3}+x_{6}\right)}{3}\right)^{3}-0=\frac{1}{27}
$$

Equality is achieved if the three sums $x_{1}+x_{4}, x_{2}+x_{5}$, and $x_{3}+x_{6}$ are equal to $\frac{1}{3}$ and if at least one of the numbers $x_{1}$, $x_{3}$, and $x_{5}$ and at least one of the numbers $x_{2}, x_{4}$, and $x_{6}$ are equal to zero. This is indeed possible, for example, for $x_{1}=x_{2}=x_{3}=\frac{1}{3}, x_{4}=x_{5}=x_{6}=0$, so the maximum value of the number $A$ is $\frac{1}{27}$.

Let's check all cases of equality. Without loss of generality, assume that $x_{1}=0$. Then from the equality $x_{1}+x_{4}=\frac{1}{3}$, we get that the number $x_{4}$ is uniquely determined and equal to $\frac{1}{3}$, so one of the numbers $x_{2}$ and $x_{6}$ must be zero. We conclude that it is necessary for two consecutive numbers in the $n$-gon to be equal to zero. Without loss of generality, assume that $x_{2}=0$, then similarly we get $x_{5}=\frac{1}{3}$. Finally, from the last condition $x_{3}+x_{6}=\frac{1}{3}$, we get that equality is achieved for sextuples $\left(x_{1}, x_{2}, x_{3}, x_{4}, x_{5}, x_{6}\right)$ of the form

$$
\left(0,0, t, \frac{1}{3}, \frac{1}{3}, \frac{1}{3}-t\right), \quad t \in\left[0, \frac{1}{3}\right]
$$

Since we assumed without loss of generality that $x_{1}=x_{2}=0$, we conclude that all sextuples of numbers for which equality $A=\frac{1}{27}$ is achieved are given by cyclic permutations of the above sextuple.