Note: Rearrangement Inequality is
$$x_ny_1 + \ldots + x_1y_n \leq x_{\sigma(1)}y_1+ \ldots + x_{\sigma(n)}y_n \leq x_1y_1+\ldots + x_ny_n$$
for every choice of real numbers
$$x_1 \leq \ldots \leq x_n$$ and
$$y_1 \leq \ldots \leq y_n$$
and every permutation $x_{\sigma(1)}, \ldots, x_{\sigma(n)}$ of $x_1, \ldots , x_n$.
I need to find all permutations which gives the same sum.
For example, for $$\sigma =\begin{pmatrix} 1& 2& 3& 4& 5& 6\\ 2& 5& 6& 3& 4& 1 \end{pmatrix}, \omega =\begin{pmatrix} 1& 2& 3& 4& 5& 6\\ 6& 3& 4& 1& 2& 5 \end{pmatrix}, \theta =\begin{pmatrix} 1& 2& 3& 4& 5& 6\\ 6& 1& 4& 5& 2& 3 \end{pmatrix}$$ The sum is $ \sum_{i=1}^{6} i\cdot \sigma(i)= \sum_{i=1}^{6} i\cdot \theta(i)= \sum_{i=1}^{6} i\cdot \omega(i)=68$.
Question: Find the condition for permutations $\sigma, \theta$ for which $\sum_{i=1}^{n} i\cdot \sigma(i)= \sum_{i=1}^{n} i\cdot \theta(i)$.