Integers divided into two gruops that all groups have the closest possible sums.
Values ​​must be divided into two groups so that the amount of groups would be as close as possible.Use backtrack.
For example:
Values: s1=2, s2=3, s3=4, s4=2, s5=4.
Sum=15
Group1: s3=4, s5=4 //Sum=8
Group2: s1=2, s2=3, s4=2 //Sum=7
Better in c or pascal.
Integers divided into two gruops that all groups have the closest possible sums.
===

Values ​​must be divided into two groups so that the amount of groups would be as close as possible.Use backtrack.
For example:
Values: s1=2, s2=3, s3=4, s4=2, s5=4.
Sum=15
Group1: s3=4, s5=4 //Sum=8
Group2: s1=2, s2=3, s4=2 //Sum=7
Better in c or pascal.