20. (SWE 2) Given the integer $n>1$ and the real number $a>0$ determine the maximum of $\sum_{i=1}^{n-1} x_{i} x_{i+1}$ taken over all nonnegative numbers $x_{i}$ with sum $a$.
20. Let $x_{k}=\max \left\{x_{1}, x_{2}, \ldots, x_{n}\right\}$. Then $x_{i} x_{i+1} \leq x_{i} x_{k}$ for $i=1,2, \ldots, k-1$ and $x_{i} x_{i+1} \leq x_{k} x_{i+1}$ for $i=k, \ldots, n-1$. Summing up these inequalities for $i=1,2, \ldots, n-1$ we obtain
$$
\sum_{i=1}^{n-1} \leq x_{k}\left(x_{1}+\cdots+x_{k-1}+x_{k+1}+\cdots+x_{n}\right)=x_{k}\left(a-x_{k}\right) \leq \frac{a^{2}}{4} .
$$

We note that the value $a^{2} / 4$ is attained for $x_{1}=x_{2}=a / 2$ and $x_{3}=\cdots=$ $x_{n}=0$. Hence $a^{2} / 4$ is the required maximum.