The basic one, number of ways of distributing $N$ objects among $R$ baskets without any limit has a general formula $C(N + R -1, R -1 )$. But here there is limit on each basket capacity , like example
$$x_1 + x_2 + x_3 + x_4 .... = N$$
with $0 \leq x_1 \leq k_1$, $0 \leq x_2 \leq k_2$, $0 \leq x_3 \leq k_3$, $0 \leq x_4 \leq k_4$. Here $k_1,k_2,k_3,k_4$ can be anything less than $N$ and each has a different value. I am unable to figure it out. Someone please help me in this.