How many ways I can put r1 (same) balls with color 1 , r2 balls with color 2 , ..., rp balls with color p in q different boxes with sizes s1,**s2**,..,**sq** ?
note : r1+r2...+rp=s1+s2+...+sq=N
note 2: N<=1000
I don't have a good algorithm to solve this problem .