Say you've got $B$ buckets, each having a particular discreet capacity $c_b, 1\leq b\leq B$. Then you want to distribute all of $I$ of identical items. How many possible combinations do you have.
For example you have $I=3$ items and $B=4$ buckets with capacities $c_1=3, c_2=2, c_3=2, c_4=1$. Is there a (smart) way to determine that there exist only 14 possible valid combinations?