Given $0<p \leqslant a_{1}, a_{2}, \cdots, a_{n} \leqslant q$, find the maximum value of $F=\left(a_{1}+a_{2}+\cdots+\right.$ $\left.a_{n}\right)\left(\frac{1}{a_{1}}+\frac{1}{a_{2}}+\cdots+\frac{1}{a_{n}}\right)$.
1. The maximum value of $F$ is: $n^{2}+\left[\frac{n}{2}\right]\left[\frac{n+1}{2}\right]\left(\sqrt{\frac{p}{q}}-\sqrt{\frac{q}{p}}\right)^{2}$. Since $F$ is continuous on a closed domain, it must have a maximum value. Fix $a_{1}, a_{2}, \cdots, a_{n-1}$, and let $a_{1}+a_{2}+\cdots+a_{n-1}=A$, $\frac{1}{a_{1}}+\frac{1}{a_{2}}+\cdots+\frac{1}{a_{n-1}}=B$, then $A, B$ are constants, and $F=\left(A+a_{n}\right)\left(B+\frac{1}{a_{n}}\right)=1+$ $A B+B a_{n}+\frac{A}{a_{n}}$. Consider $f(x)=B x+\frac{A}{x}$, it is easy to see that when $x \leqslant \sqrt{\frac{A}{B}}$, $f(x)$ is monotonically decreasing, and when $x \geqslant \sqrt{\frac{A}{B}}$, $f(x)$ is monotonically increasing. Thus, $\sqrt{\frac{A}{B}}$ is the minimum point of $f(x)$. Noting that $p \leqslant$ $a_{n} \leqslant q$, so $f\left(a_{n}\right)=B a_{n}+\frac{A}{a_{n}}$ can only take its maximum value at the endpoints $a_{n}=p$ or $a_{n}=q$. By symmetry, $F$ can only take its maximum value when $a_{1}, a_{2}, \cdots, a_{n} \in\{p, q\}$. Therefore, suppose $F$ takes its maximum value when $a_{1}, a_{2}, \cdots, a_{n}$ have $k$ values of $p$ and $n-k$ values of $q$, then the maximum value of $F$ is the maximum value of $F(k)$ in the following form: $F(k)=[k p+(n-k) q]\left(\frac{k}{p}+\frac{n-k}{q}\right)=k^{2}+(n-$ $k)^{2}+\left(n k-k^{2}\right)\left(\frac{p}{q}+\frac{q}{p}\right)=\left[2-\left(\frac{p}{q}+\frac{q}{p}\right)\right] k^{2}+\left[n\left(\frac{p}{q}+\frac{q}{p}\right)-2 n\right] k+n^{2}$. In the quadratic function $F(k)$, the coefficient of the quadratic term $2-\left(\frac{p}{q}+\frac{q}{p}\right)<0$, and the vertex's x-coordinate is $\frac{n}{2}$. But $k \in \mathbf{N}$, thus, when $n$ is even, $F(k) \leqslant F\left(\frac{n}{2}\right)=\left(\frac{n}{2}\right)^{2}+\left(n-\frac{n}{2}\right)^{2}+$ $\left[n \cdot \frac{n}{2}-\left(\frac{n}{2}\right)^{2}\right]\left(\frac{p}{q}+\frac{q}{p}\right)=n^{2}+\left(\frac{n}{2}\right)^{2}\left(\sqrt{\frac{p}{q}}-\sqrt{\frac{q}{p}}\right)^{2}=n^{2}+$ $\left[\frac{n}{2}\right]\left[\frac{n+1}{2}\right]\left(\sqrt{\frac{p}{q}}-\sqrt{\frac{q}{p}}\right)^{2}$. When $n$ is odd, $F(k) \leqslant F\left(\left[\frac{n}{2}\right]\right)=$ $F\left(\left[\frac{n+1}{2}\right]\right)=n^{2}+\left[\frac{n}{2}\right]\left[\frac{n+1}{2}\right]\left(\sqrt{\frac{p}{q}}-\sqrt{\frac{q}{p}}\right)^{2}$. Therefore, $F_{\max }=n^{2}+$ $\left[\frac{n}{2}\right]\left[\frac{n+1}{2}\right]\left(\sqrt{\frac{p}{q}}-\sqrt{\frac{q}{p}}\right)^{2}$.