We have $n$ types of objects, and the number of objects of type $i$ is $a_i$, $1\leq i\leq n$.
What is the number of permutation of the $\sum_{i=1}^n a_i$ objects, if no two objects of the same type are next to each other?
A simple example: If we have the objects $\{a,a,a,b,b,c,c\}$, then we allow $abcabac$ but not $aaabbcc$.