First consider the concave sequence ai=(1389−i)d, 0≤i≤1389, d>0. Note that the maximum possible value of c for this sequence is c0=∑i=01389ai2∑i=01389iai2=4×1389−213892−5×1389.
Now we claim that for every concave sequence ai, we have ∑i=01389iai2≥c0∑i=01389ai2, and since we have the above equality, c0 must be the answer.
Consider a concave sequence a0,a1,…,a1389, we define
bi=(1389−i)1389−⌊c0⌋a⌊c0⌋
Indeed we are trying to make the sequence linear. Now we must prove that:
i=⌊c⌋∑1389(i−c)ai2≥i=0∑⌊c⌋(c−i)ai2
Considering the definition of bi and its linearity, and the fact that a⌊c0⌋=b⌊c0⌋, a1389≥b1389, easily it can be proved that if i≥⌊c0⌋ then ai≥bi, and if i≤⌊c0⌋ then ai≤bi. So we have:
i=⌊c0⌋∑1389(i−c0)ai2≥i=⌊c0⌋∑1389(i−c0)bi2≥i=0∑⌊c0⌋(c0−i)bi2≥i=0∑⌊c0⌋(c0−i)ai2
So the desired c equals to c0=4×1389−213892−5×1389.