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][1], 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 graphs, which are unique.  


  [1]: https://en.wikipedia.org/wiki/Tur%C3%A1n%27s_theorem