Simple problem on restricted partition When finding number of ways to partition n distinct chocolates among m children such that each child has at most 
$$\left\{\begin{matrix}
\left \lfloor \frac{n}{m} \right \rfloor &  \text{if} \ \ n\ \ \left (mod \ \ m  \right )\equiv 0 \\
\\
\left \lceil \frac{n}{m} \right \rceil & \text{if} \ \ n\ \ \left (mod \ \ m  \right )\not\equiv 0
\end{matrix}\right.$$
How can find the number of unique partitions be found?
For example n=5 and m=3 the answer is 90
 A: This is a bit messy. Suppose that $r$ children get $q+1$ chocolates each, and the remaining $m-r$ get $q$ chocolates each. There are $\binom{m}{m-r}=\binom{m}r$ ways to choose which children get $q$ chocolates. The first of those can get any of $\binom{n}q$ sets of $q$ chocolates; the second can then get any of the $\binom{n-q}q$ remaining sets of $q$ chocolates; and so on. Thus, there are 
$$\binom{m}r\binom{n}{q,q,\dots,q}$$
ways to choose and accommodate the $m-r$ children who get $q$ chocolates each, where the multinomial coefficient has $n-r$ $q$’s.
That leaves $r(q+1)$ chocolates for the $r$ lucky children who get $q+1$ each; they can be distributed in 
$$\binom{r(q+1)}{q+1,q+1,\dots,q+1}$$
ways, where the multinomial coefficient has $r$ lower numbers. The total number of distributions is therefore
$$\binom{m}r\binom{n}{q,q,\dots,q}\binom{r(q+1)}{q+1,q+1,\dots,q+1}=\binom{m}r\binom{n}{q,\dots,q,q+1,\dots,q+1}\;,$$
where the last multinomial coefficient has $m-r$ $q$’s and $r$ $(q+1)$’s. In your example of $n=5,m=3$ we have $q=1$ and $r=2$, so this becomes
$$\binom32\binom5{1,2,2}=3\cdot\frac{5!}{1!2!2!}=3\cdot30=90\;.$$
