An upperbound on a frequencies problem
Solution 1:
Let $(f_1,\ldots,f_n)$ be a list of frequencies with $\sum_{i=1}^nif_i$ maximal, and suppose it is not $(\frac mn,\ldots,\frac mn)$.
Then there must exist $1\le i_0<n$ such that $f_1\ge\cdots\ge f_{i_0}>\frac mn\ge f_{i_0+1}\cdots\ge f_n$ (otherwise, $\sum_{i=1}^nf_i$ would be either smaller or greater than $m$). Now, let $$\varepsilon:=\frac{f_{i_0}-f_{i_0+1}}2>0$$ and consider $$\widetilde{f_i}:=\begin{cases}f_i&\text{if $i\notin\{i_0,i_0+1\}$,} \\f_i-\varepsilon&\text{if $i=i_0$,}\\ f_i+\varepsilon&\text{if $i=i_0+1$.}\end{cases}$$ It is easily checked that $\sum_{i=1}^n\widetilde{f_i}=m$ and that $\widetilde f\!_1\ge\cdots\ge\widetilde f\!_n$. We find $$\sum_{i=1}^ni(\widetilde f\!_i-f_i)=-i_0\varepsilon+(i_0+1)\varepsilon=\varepsilon>0,$$ which contredicts the maximality of $(f_1,\ldots,f_n)$.
Thus $(\frac mn,\ldots,\frac mn)$ is the only list of frequencies for which $\sum_{i=1}^nif_i$ can be maximal. (One should also make sure that the maximum exists, but this is easily done by a compactness argument.)