I'm having a very hard time trying to figure out how to solve this problem efficiently. Let me describe how it goes:A hard working mom bought several fruits with different nutritional values for her 3 kids, Amelia, Jessica and Bruno. Both girls are overweight, and they are very vicious and always leave poor Bruno with nothing, so their mother decided to share the food in the following manner:Amelia being the heaviest one gets the most amount of Nutritional Value.Jessica gets an amount equal or less than AmeliaBruno gets an amount equal or less than Jessica, but you need to find a way to give him the highest possible nutritional value while respecting the rule ( $A \geq J \geq B$ )One of the test cases given by my teacher is the following:The fruit list has the following values { 4, 2, 1, 8, 11, 5, 1Input:7   -----> Number of Fruits4 2 1 8 11 5 1 ----> Fruits Nutritional ValuesOutput:1 11  ---->  One fruit, their nutritional values sum for Amelia5     ---->  Position of the fruit in the list3 11  ---->  Three fruits, their nutritional values sum for Jessica1 2 6 ---->  Position of the fruits in the list3 10  ---->  Three fruits, their nutritional values sum for Bruno3 4 7 ---->  Position of the fruits in the listNote: I am aware that there are several ways of diving the fruits among the kids, but it doesn't really matter as long as it follows the rule $A \geq J \geq B$.I'm trying to make a program in C# that solves this kind of problems but I need an efficient formula to make this work. Generating all the subsets is out of the question because it is very consuming task. The list of fruits can have up to $50$ elements, $2^{50}$ is a huge number.
Partition of a set of integer into 3 subsets of approximately equal sum
algorithms;integers;approximation;linear programming