Someone, please, make that title more readable. My lack of math English does not let me.
Given $A = a_1 + ... + a_k;\ A, a_i > 0$ what is $\max\left(\sum_{i<j}a_i a_j\right)$?
An obvious upper bound is $\dfrac{A^2}{2}$, because $\sum_{i<j}a_i a_j = \dfrac{A^2 - \sum_i a_i^2}{2}$.
Something tells me the maximum is when $\forall i\ a_i = \dfrac{A}{k}$, but I cannot prove it properly.
Hint: formulate this as a constraint maximization problem and apply Lagrange Multipliers. The $a_i$ are the input and they’re subject to the constraint that $\sum a_i=A$.