Problem: The $2010$ positive real numbers $a_1$, $a_2$, \dots , $a_{2010}$
satisfy the inequality $a_i a_j \le i+j$
for all $1 \le i < j \le 2010$.
Determine, with proof, the largest possible value
of the product $a_1a_2\dots a_{2010}$.

Solution: The answer is $3 \times 7 \times 11 \times \dots \times 4019$,
which is clearly an upper bound
(and it's not too hard to show this is the lowest
number we may obtain by multiplying $1005$ equalities together;
this is essentially the rearrangement inequality).
The tricky part is the construction.
Intuitively we want $a_i \approx \sqrt{2i}$,
but the details require significant care.

Note that if this is achievable,
we will require $a_n a_{n+1} = 2n+1$ for all odd $n$.
Here are two constructions:
\begin{itemize}
\ii One can take the sequence such that $a_{2008} a_{2010} = 4018$
  and $a_n a_{n+1} = 2n+1$ for all $n = 1, 2, \dots, 2009$.
  This can be shown to work by some calculation. As an illustrative example,
  \[ a_1 a_4 = \frac{a_1a_2 \cdot a_3a_4}{a_2a_3} = \frac{3 \cdot 7}{5} < 5. \]

\ii In fact one can also take $a_n = \sqrt{2n}$ for all even $n$
  (and hence $a_{n-1} = \sqrt{2n} - \frac{1}{\sqrt{2n}}$ for such even $n$).
\end{itemize}

\begin{remark*}
This is a chief example of an ``abstract'' restriction-based approach.
One can motivate it in three steps:
\begin{itemize}
\ii The bound $3 \cdot 7 \cdot \dots \cdot 4019$ is provably best possible
upper bound by pairing the inequalities;
also the situation with $2010$ replaced by $4$
is constructible with bound $21$.
\ii We have $a_n \approx \sqrt{2n}$ heuristically;
in fact $a_n = \sqrt{2n}$ satisfies inequalities by AM-GM.
\ii So we are most worried about $a_i a_j \le i+j$
when $|i-j|$ is small, like $|i-j| = 1$.
\end{itemize}
I then proceeded to spend five hours on various constructions,
but it turns out that the right thing to do was just require
$a_k a_{k+1} = 2k+1$, to make sure these pass:
and the problem almost solves itself.
\end{remark*}

\begin{remark*}
  When $2010$ is replaced by $4$
  it is not too hard to manually write an explicit example:
  say $a_1 = \frac{\sqrt3}{1.1}$, $a_2 = 1.1\sqrt3$,
  $a_3 = \frac{\sqrt7}{1.1}$ and $a_4 = 1.1\sqrt7$.
  So this is a reason one might guess that
  $3 \times 7 \times \dots \times 4019$
  can actually be achieved in the large case.
\end{remark*}

\begin{remark*}
  Victor Wang says:
  I believe we can actually prove that WLOG (!) assume $a_i a_{i+1} = 2i+1$
  for all $i$ (but there are other ways to motivate that as well,
  like linear programming after taking logs),
  which makes things a bit simpler to think about.
\end{remark*}