Skip to main content
2 of 4
deleted 2 characters in body
Tony Huynh
  • 32.1k
  • 11
  • 112
  • 187

This was essentially answered by Nate in the comments, but here are some details. As Nate argues, $|m_i - m_j| \leq 1$ for all distinct $i,j$. Thus, if $s=ak+r$, where $a,r \in \mathbb{N}$ and $r < k$, then there is a unique choice (up to permuting variables) which maximizes the product. Namely, set $r$ of the variables to $\lceil s/k \rceil$ and the rest to $\lfloor s/k \rfloor$. This problem is related to Turán's Theorem, which concerns the maximum possible number of edges in a graph on $s$ vertices with no $K_{k+1}$ subgraph. The answer is the given by the Turán graph, which is unique.

Tony Huynh
  • 32.1k
  • 11
  • 112
  • 187