e.g. 12 balls and 3 boxes, how can i add list to all combinations with using all balls. for example n is 12, k is 3:
- (12,0,0)
- (0,12,0)
- (0,0,12)
- (0,1,11)
- (0,11,1)
- (11,1,0)
- (11,0,1)
- (10,1,1)...
Python, c#, Java... One of these three languages would be great for me.
EDIT: This is not a homework. This algortihm will be used later for allocation.