
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system

Given two sorted arrays:
$$
a_{1} \leqslant a_{2} \leqslant \cdots \leqslant a_{n}, \quad b_{1} \leqslant b_{2} \leqslant \cdots \leqslant b_{n},
$$

and a permutation \(i_{1}, i_{2}, \cdots, i_{n}\) of \(1, 2, \cdots, n\), then

$$
\begin{aligned}
& a_{1} b_{n} + a_{2} b_{n-1} + \cdots + a_{n} b_{1} \\
\leqslant & a_{1} b_{i_{1}} + a_{2} b_{i_{2}} + \cdots + a_{n} b_{i_{n}} \\
\leqslant & a_{1} b_{1} + a_{2} b_{2} + \cdots + a_{n} b_{n},
\end{aligned}
$$

The equality holds if and only if \(a_{1} = a_{2} = \cdots = a_{n}\) or \(b_{1} = b_{2} = \cdots = b_{n}\).

Present the answer in LaTex format: \boxed{Your answer}
user