Can anyone help me solve this problem.
We are given a set S with k number of elements in it.
Now we need to split the set S into x subsets, so that the difference in the number of elements in each subset is at most 1, and the sum of each subset should be as close to each other as possible.
Example 1: {10, 20, 90, 200, 100} should be divided into 2 subsets
Solution: {10200} {20,90,100}
the amount is 210 and 210
Example 2: {1, 1, 2, 1, 1, 1, 1, 1, 1, 6}
Solution: {1,1,1,1,6} {1,2,1,1,1}
The sum is 10 and 6.