Let $n$ be a fixed positive integer. Find the maximum possible value of  
$$ \sum_{1 \leqslant r<s \leqslant 2 n}(s-r-n) x_{r} x_{s}, $$  
where $-1 \leqslant x_{i} \leqslant 1$ for all $i=1,2, \ldots, 2 n$. (Austria) Answer. $n(n-1)$.
Let $Z$ be the expression to be maximized. Since this expression is linear in every variable $x_{i}$ and $-1 \leqslant x_{i} \leqslant 1$, the maximum of $Z$ will be achieved when $x_{i}=-1$ or 1. Therefore, it suffices to consider only the case when $x_{i} \in\{-1,1\}$ for all $i=1,2, \ldots, 2 n$. For $i=1,2, \ldots, 2 n$, we introduce auxiliary variables 
$$ y_{i}=\sum_{r=1}^{i} x_{r}-\sum_{r=i+1}^{2 n} x_{r} $$
Taking squares of both sides, we have 
$$ \begin{aligned} y_{i}^{2} & =\sum_{r=1}^{2 n} x_{r}^{2}+\sum_{r<s \leqslant i} 2 x_{r} x_{s}+\sum_{i<r<s} 2 x_{r} x_{s}-\sum_{r \leqslant i<s} 2 x_{r} x_{s} \\ & =2 n+\sum_{r<s \leqslant i} 2 x_{r} x_{s}+\sum_{i<r<s} 2 x_{r} x_{s}-\sum_{r \leqslant i<s} 2 x_{r} x_{s}, \end{aligned} $$
where the last equality follows from the fact that $x_{r} \in\{-1,1\}$. Notice that for every $r<s$, the coefficient of $x_{r} x_{s}$ in (1) is 2 for each $i=1, \ldots, r-1, s, \ldots, 2 n$, and this coefficient is -2 for each $i=r, \ldots, s-1$. This implies that the coefficient of $x_{r} x_{s}$ in $\sum_{i=1}^{2 n} y_{i}^{2}$ is $2(2 n-s+r)-2(s-r)=$ $4(n-s+r)$. Therefore, summing (1) for $i=1,2, \ldots, 2 n$ yields 
$$ \sum_{i=1}^{2 n} y_{i}^{2}=4 n^{2}+\sum_{1 \leqslant r<s \leqslant 2 n} 4(n-s+r) x_{r} x_{s}=4 n^{2}-4 Z $$
Hence, it suffices to find the minimum of the left-hand side. Since $x_{r} \in\{-1,1\}$, we see that $y_{i}$ is an even integer. In addition, $y_{i}-y_{i-1}=2 x_{i}= \pm 2$, and so $y_{i-1}$ and $y_{i}$ are consecutive even integers for every $i=2,3, \ldots, 2 n$. It follows that $y_{i-1}^{2}+y_{i}^{2} \geqslant 4$, which implies 
$$ \sum_{i=1}^{2 n} y_{i}^{2}=\sum_{j=1}^{n}\left(y_{2 j-1}^{2}+y_{2 j}^{2}\right) \geqslant 4 n $$
Combining (2) and (3), we get 
$$ 4 n \leqslant \sum_{i=1}^{2 n} y_{i}^{2}=4 n^{2}-4 Z $$
Hence, $Z \leqslant n(n-1)$. If we set $x_{i}=1$ for odd indices $i$ and $x_{i}=-1$ for even indices $i$, then we obtain equality in (3) (and thus in (4)). Therefore, the maximum possible value of $Z$ is $n(n-1)$, as desired. 

Comment 1. $Z=n(n-1)$ can be achieved by several other examples. In particular, $x_{i}$ needs not be $\pm 1$. For instance, setting $x_{i}=(-1)^{i}$ for all $2 \leqslant i \leqslant 2 n$, we find that the coefficient of $x_{1}$ in $Z$ is 0. Therefore, $x_{1}$ can be chosen arbitrarily in the interval $[-1,1]$. Nevertheless, if $x_{i} \in\{-1,1\}$ for all $i=1,2, \ldots, 2 n$, then the equality $Z=n(n-1)$ holds only when $\left(y_{1}, y_{2}, \ldots, y_{2 n}\right)=(0, \pm 2,0, \pm 2, \ldots, 0, \pm 2)$ or $( \pm 2,0, \pm 2,0, \ldots, \pm 2,0)$. In each case, we can reconstruct $x_{i}$ accordingly. The sum $\sum_{i=1}^{2 n} x_{i}$ in the optimal cases needs not be 0, but it must equal 0 or $\pm 2$.

Comment 2. Several variations in setting up the auxiliary variables are possible. For instance, one may let $x_{2 n+i}=-x_{i}$ and $y_{i}^{\prime}=x_{i}+x_{i+1}+\cdots+x_{i+n-1}$ for any $1 \leqslant i \leqslant 2 n$. Similarly to Solution 1, we obtain $Y:=y_{1}^{\prime 2}+y_{2}^{\prime 2}+\cdots+y_{2 n}^{\prime 2}=2 n^{2}-2 Z$. Then, it suffices to show that $Y \geqslant 2 n$. If $n$ is odd, then each $y_{i}^{\prime}$ is odd, and so $y_{i}^{\prime 2} \geqslant 1$. If $n$ is even, then each $y_{i}^{\prime}$ is even. We can check that at least one of $y_{i}^{\prime}, y_{i+1}^{\prime}, y_{n+i}^{\prime}$, and $y_{n+i+1}^{\prime}$ is nonzero, so that $y_{i}^{\prime 2}+y_{i+1}^{\prime 2}+y_{n+i}^{\prime 2}+y_{n+i+1}^{\prime 2} \geqslant 4$; summing these up for $i=1,3, \ldots, n-1$ yields $Y \geqslant 2 n$.