(Equal sums give the largest product)If nonnegative real numbers $x_1,\dots,x_n$ have sum $S$, then $x_1\cdots x_n\le\left(\frac Sn\right)^n$, with equality when all $x_i=\frac Sn$. If the $x_i$ must be nonnegative integers, the product is largest when any two of them differ by at most $1$ (replacing $p,q$ with $q\ge p+2$ by $p+1,q-1$ increases $pq$). Other constraints must be handled separately.
← Back to Exercise 1194