Possible Duplicate:
How to distribute $k$ distinct items into $r$ distinct groups with each groups receiving $a (=k-n)$ prizes at most?
How many ways you can use to put N books on H shelves, but the shelf's must contain not more than X books? I would like to solve it by composition (number theory)..but nothing.. Please help me, thanks a lot.