3. Given numbers $x_{1}, \ldots, x_{n}$ from the interval $\left[0, \frac{\pi}{2}\right]$. Find the maximum value of the expression

$$
A=\left(\sqrt{\sin x_{1}}+\ldots+\sqrt{\sin x_{n}}\right) \cdot\left(\sqrt{\cos x_{1}}+\ldots+\sqrt{\cos x_{n}}\right) .
$$
Answer: $\frac{n^{2}}{\sqrt{2}}$.

Solution. Note that for any $a_{1}, \ldots, a_{n}$

$$
\left(\sum_{k=1}^{n} a_{k}\right)^{4} \leqslant\left(n \sum_{k=1}^{n} a_{k}^{2}\right)^{2} \leqslant n^{3} \sum_{k=1}^{n} a_{k}^{4}
$$

From this, by the Cauchy-Schwarz inequality,

$$
A^{2} \leqslant \frac{1}{2}\left(\left(\sum_{k=1}^{n} \sqrt{\sin x_{k}}\right)^{4}+\left(\sum_{k=1}^{n} \sqrt{\cos x_{k}}\right)^{4}\right) \leqslant \frac{n^{3}}{2}\left(\sum_{k=1}^{n} \sin ^{2} x_{k}+\sum_{k=1}^{n} \cos ^{2} x_{k}\right)=\frac{n^{4}}{2}
$$

Therefore, $A \leqslant \frac{n^{2}}{\sqrt{2}}$. Equality is achieved when $x_{1}=\ldots=x_{n}=\frac{\pi}{4}$.