I have a set of values that I need to distribute into n-groups of max size z in such a way that the mean is approximately the same.
Example:
weights