18.6. (SRP, 79). Given positive numbers $a_{1}<a_{2}<\ldots$ $\ldots<a_{n}$. For which permutation $\left(b_{1} ; b_{2} ; \ldots ; b_{n}\right)$ of these numbers is the product

$$
\prod_{i=1}^{n}\left(a_{i}+1 / b_{i}\right)
$$

maximal?
18.6. Let $A=\prod_{i=1}^{n} a_{i}$. For numbers $0<a_{i}<\ldots<a_{n}$, we have 

\[
\prod_{i=1}^{n}\left(a_{i}+1 / b_{i}\right)=\prod_{i=1}^{n}\left(\left(a_{i} b_{i}+1\right) / b_{i}\right)=(1 / A) \prod_{i=1}^{n}\left(a_{i} b_{i}+1\right) \leq
\]

\[
\leq(1 / A) \prod_{i=1}^{n}\left(a_{i}^{2}+1\right)
\]

(to prove the last inequality, it is sufficient to note that

\[
\left(a_{i} b_{i}+1\right)^{2}=a_{i}^{2} b_{i}^{2}+2 a_{i} b_{i}+1 \leqslant a_{i}^{2} b_{i}^{2}+a_{i}^{2}+b_{i}^{2}+1=\left(a_{i}^{2}+1\right)\left(b_{i}^{2}+1\right)
\]

from which

\[
\left.\prod_{i=1}^{n}\left(a_{i} b_{i}+1\right)^{2} \leq \prod_{i=1}^{n}\left(a_{i}^{2}+1\right)\left(b_{i}^{2}+1\right)=\prod_{i=1}^{n}\left(a_{i}^{2}+1\right)^{2}\right)
\]

Equality is achieved, and only if $2 a_{i} b_{l}=a_{i}^{2}+b_{i}^{2}$ for all $i=1, \ldots, n$. Thus, the product specified in the problem is maximal only in the case

\[
\left(b_{1} ; \ldots ; b_{n}\right)=\left(a_{1} ; \ldots ; a_{n}\right)
\]