I'm trying to figure out how to get all combinations
of putting x*n
balls into n
boxes.
There should be the same number of balls in each box.
If it was about putting n balls into n boxes, the result would be n!
and the pseudocode:
for b1 in set:
for b2 in set-b2:
for b3 in set-b2-b3:
results.append(b1,b2,b3,b4)
How can I get this way combinations of x*n
instead of n
balls so in one box there is x
balls exactly?