Apparently it should be rather easy, but I cannot figure it out. We have n piles and want to divide at most k over these piles. The number of possibilities is (n+k) choose n, but why?
Example to illustrate the problem:
n = 2
k = 2
The possibilities: (0,0), (0,1), (1,0), (2,0), (1,1), (0,2)