Let $s_{1}, s_{2}, \ldots, s_{2004}$ be non-negative real numbers whose sum is 2, and we know that

$$
s_{1} s_{2}+s_{2} s_{3}+\ldots+s_{2003} s_{2004}+s_{2004} s_{1}=1
$$

Determine the possible minimum and maximum value of $S=s_{1}^{2}+s_{2}^{2}+\ldots+s_{2004}^{2}$ under these conditions.
Solution. We will show that the given conditions impose very strong constraints on the $s_{i}$ numbers: at most three of them can be positive, and if we arrange them in a circle in increasing order of their indices, these three non-zero elements are adjacent. During the solution, we will interpret the indices cyclically, so $s_{2005}=s_{1}$, etc.

The sum of the given numbers is 2 and none of them is negative. Therefore, there is a positive number among them, and by symmetry, we can assume that this is $s_{1}$. We will show that in this case the sum of the elements cyclically adjacent to $s_{1}$, $s_{2004}+s_{2}=1$, and the value of every other even-indexed element is zero.

Let $s_{1}>0$ and let $A$ be the sum of the even-indexed elements. Group the terms of the given sum in pairs and factor out the common odd-indexed factors in these pairs: $1=s_{1} s_{2}+s_{2} s_{3}+\ldots+s_{2004} s_{1}=$ $s_{1}\left(s_{2004}+s_{2}\right)+s_{3}\left(s_{2}+s_{4}\right)+\ldots+s_{2003}\left(s_{2002}+s_{2004}\right)$. The right-hand side can be estimated from above: in each term, $s_{2 i}+s_{2 i+2} \leq A$, and the first factor is non-negative; the right-hand side is therefore at most

$$
s_{1} A+s_{3} A+\ldots+s_{2003} A=\underbrace{\left(s_{1}+s_{3}+\ldots+s_{2003}\right)}_{2-A} A=(2-A) A
$$

Since $A \geq 0$, by the arithmetic and geometric means inequality, $(2-A) A \leq 1$, and considering the entire chain of inequalities, equality holds everywhere! Thus $A=1$, and furthermore, $s_{1}\left(s_{2004}+s_{2}\right)=s_{1} A=s_{1}, s_{3}\left(s_{2}+s_{4}\right)=s_{3}, s_{5}\left(s_{4}+s_{6}\right)=$ $s_{5}, \ldots, s_{2003}\left(s_{2002}+s_{2004}\right)=s_{2003}$. Since $s_{1} \neq 0$, from $s_{1}\left(s_{2004}+s_{2}\right)=s_{1}$, it indeed follows that $s_{2004}+s_{2}=1$, and if we take into account that the sum of the even-indexed elements, $A=1$, we indeed get that every other even-indexed element is zero. The cyclic symmetry now means that the sum of the two elements surrounding any non-zero element is 1, and the values of the other elements with the same parity are zero. This also implies that if two elements have opposite parity indices, they can only both be positive if they are adjacent.

Now the sum of the two neighbors of $s_{1}$ is 1, so one of them, for example, $s_{2}$, is also positive. According to the above, $s_{1}+s_{3}=1$, and the values of the other odd-indexed elements, $s_{5}, s_{7}, \ldots, s_{2003}$, are also zero. Moreover, $s_{3}$ and $s_{2004}$ are not adjacent, and their indices have opposite parity, so one of them is also zero. Thus, from $s_{1}+s_{3}=s_{2}+s_{2004}=1$, it follows that the value of $s_{1}$ or $s_{2}$ is 1.

Summarizing our investigations: in the case of the given conditions, among the 2004 numbers, at most three are non-zero, these are cyclically adjacent, the value of the middle one is 1, and the sum of its two neighbors is 1.

For such numbers, the minimum and maximum values of the sum $x^{2}+y^{2}+1$ must be determined under the condition $x+y=1,0 \leq x, y$. This is the determination of the extreme values of the function

$$
f(x)=x^{2}+(1-x)^{2}+1=2\left(x-\frac{1}{2}\right)^{2}+\frac{3}{2}
$$

on the interval $[0 ; 1]$. From the complete square form, it is clear that the minimum value of the function is $f\left(\frac{1}{2}\right)=\frac{3}{2}$, and the maximum value is $f(0)=f(1)=2$.

Therefore, for the sum of squares $S$ of the 2004 numbers, $\frac{3}{2} \leq S \leq 2$. If $s_{1}=s_{3}=\frac{1}{2}, s_{2}=1$, and the values of the other elements are zero, then $S=\frac{3}{2}$, and if $s_{1}=s_{2}=1$, and the values of the other elements are zero, then $S=2$.

Remark. In the solution, we used the fact that the number of elements is even and that there are at least six elements. If we only have 4 numbers, it can be easily shown that $1 \leq S \leq 2$ (the minimum is obtained with $s_{1}=s_{2}=s_{3}=s_{4}=\frac{1}{2}$), but the case of an odd number of elements does not seem easy.