for total, roster in oldmoves.items():
    for p in roster:
        people_left = roster[:]
people_left.remove(p)
newtotal = total + p
if newtotal > halftotalscore:
    continue
newmoves[newtotal] = people_left
oldmoves = newmoves
solution = min(map(lambda i: (abs(float(i) - halftotalscore), i), list(oldmoves.
    keys())))
return solution[1], sum(oldmoves[solution[1]]), oldmoves[solution[1]]
print(team([90, 200, 100]))
print(team([2, 3, 10, 5, 8, 9, 7, 3, 5, 2]))
print(team([1, 1, 1, 1, 1, 1, 1, 1, 1, 9]))
print(team([87, 100, 28, 67, 68, 41, 67, 1]))
print(team([1, 1, 50, 50, 50, 1000]))
Algorithm to Divide a list of numbers into 2 equal sum lists