There is an initial array of positive numbers, N is the number of new arrays, Mi is the maximum amount in the current array. It is necessary to distribute all the numbers from the given array into N arrays so that the sum of the numbers in each array is maximally close to the given Mi Find the best distribution option.
I am sure that there should be a ready algorithm for a similar task. Something from the category of combinatorial optimization can be. Brute force does not offer