Prove $\sum\limits_{k=1}^n a_k\sum\limits_{k=1}^n \frac1{a_k}\le\left(n+\frac12\right)^2$ then $\max a_k \le 4\min a_k$ 
Prove that
if
  \begin{align}
&0<a_1,a_2,\dots,a_n \in \mathbb R,
&\left(\sum_{k=1}^n a_k\right)\left(\sum_{k=1}^n \frac1{a_k}\right)\le\left(n+\frac12\right)^2\\
\end{align}
then
  $$\max_k \space a_k \le 4\times\min_k\space a_k$$

What I've tried was
$$\left(\sum_{k=1}^n a_k\right)\left(\sum_{k=1}^n \frac1{a_k}\right)=n+\sum_{i\ne j}\frac{a_i}{a_j}=n+\sum_{i< j}\left(\frac{a_i}{a_j}+\frac{a_j}{a_i}\right)$$
which didn't help at all. Thanks.
 A: Assume that $a_1\le\ldots\le a_n$. Suppose the contrary: $a_n>4a_1$.
Let $S$ be the sum
$$S=\sum_{1\le i<j\le n}\left(\frac{a_i}{a_j}+\frac{a_j}{a_i}\right)$$
Let's split this sum in three "parts" to bound them below:
The first, $S_1$ is just $a_1/a_n+a_n/a_1$.
$$S_1=\frac{a_1}{a_n}+\frac{a_n}{a_1}>4+\frac14=\frac{17}4$$
$S_2$ is the sum of the fractions where occurs $a_n$ or $a_1$, but not both:
$$\begin{align}
S_2&=\sum_{k=2}^{n-1}\left(\frac{a_k}{a_1}+\frac{a_k}{a_n}+\frac{a_1}{a_k}+\frac{a_n}{a_k}\right)\\
&=\left(1+\frac{a_1}{a_n}\right)\sum_{k=2}^{n-1}\left(\frac{a_k}{a_1}+\frac{a_n}{a_k}\right)\\
&\stackrel*\ge2(n-2)\left(1+\frac{a_1}{a_n}\right)\left(\frac{a_n}{a_1}\right)^{1/2}\\
&=2(n-2)\left[\left(\frac{a_n}{a_1}\right)^{1/2}+\left(\frac{a_1}{a_n}\right)^{1/2}\right]\\
&>\frac52\cdot 2(n-2)\ge 5(n-2)
\end{align}$$
Last, $S_3$ is the sum of the remaining terms:
$$S_3=\sum_{2\le i<j\le n-1}\left(\frac{a_i}{a_j}+\frac{a_j}{a_i}\right)\ge2\binom{n-2}2=n^2-5n+6$$
So
$$S>\frac{17}4+5n-10+n^2-5n+6=n^2+\frac14$$
and then
$$n+S>\left(n+\frac12\right)^2$$
Remarks: Throughout the proof I have been using two facts:


*

*The function $f(x)=x+x^{-1}$ for $x>1$ is strictly increasing.

*The sum of $r$ positive numbers whose product is $1$ is at least $r$. (This follows easily from AM-GM inequality).


For the inequality marked with $*$ I have used AM-GM inequality, too.
A: Maybe the following reasoning can help.
Let $f(a_1,a_2,...a_n)=\sum\limits_{k=1}^n a_k\sum\limits_{k=1}^n \frac1{a_k}$, $\max_{i}a_i=M$, $\min_{i}a_i=m$ and $M=xm$.
We need to prove that $x\leq4$.
Indeed, let $x>4$.
Easy to see that $\frac{\partial^2f}{\partial a_i^2}>0$ for all $i$, which says that $\max\limits_{m\leq a_i\leq M}f=\max\limits_{a_i\in\{m,M\}}f$.
Let $m$ gotten $k$ times. 
Hence, $(km+(n-k)M)\left(\frac{k}{m}+\frac{n-k}{M}\right)\leq\left(n+\frac{1}{2}\right)^2$ or $k^2+(n-k)^2+k(n-k)\left(x+\frac{1}{x}\right)\leq\left(n+\frac{1}{2}\right)^2$ and since $x+\frac{1}{x}>\frac{17}{4}$, we obtain
$$9k(n-k)<4n+1,$$
which is strange. 
A: Another way: When you see "reversals" of CS inequality, often Pólya-Szegö’s inequality is useful.  
With $\min a_k = m, \max a_k = Cm$, using Pólya-Szegö, we have
$$\sum a_k \sum \frac1{a_k} \geqslant \frac{n^2}4\left(C +\frac{1}C \right)^2$$
$$\therefore \frac{n}2\left(C + \frac1C\right) \leqslant  n+\frac12 \implies C + \frac1C \leqslant 2 + \frac1n < 3  \implies C < \frac12(1+\sqrt5) < 4$$
We can strictly bound this as for $n=1$ trivially $C=1$.  In fact the above establishes $C < 1.62$.
A: Hint:
\begin{align*}
\min_j a_j &\leq a_k \quad \text{ for every } 1 \leq k \leq n\\
\sum_{k = 1}^n \min_j a_j &\leq \sum_{k = 1}^n a_k\\
n \, \min_j a_j &\leq \sum_{k = 1}^n a_k
\end{align*}
Similarly
$$
n \frac{1}{\max\limits_j a_j} \leq \sum_{k = 1}^n \frac{1}{a_k}
$$
Hence
$$
n^2 \frac{\min\limits_j a_j}{\max\limits_i a_i} \leq \left( \sum_{k = 1}^n a_k \right)\left( \sum_{k = 1}^n \frac{1}{a_k} \right) \leq \left( n + \frac{1}{2} \right)^2 \leq \ldots
$$
This should lead to something.
Also, obviously $\frac{\max\limits_i a_i}{\min\limits_j a_j} \geq 1$. (I like having different indeces $i, j$ but these are of course dummy variables)
