import random
mempool = [(random.randint(0, 200), random.randint(0, 200))
for _ in range(20)]
mempool
[(100, 198), (50, 56), (11, 150), (149, 156), (40, 150), (144, 149), (140, 146), (185, 10), (49, 79), (69, 186), (130, 38), (95, 189), (51, 60), (99, 178), (151, 51), (196, 187), (154, 199), (43, 195), (63, 65), (172, 94)]
import itertools
def check_weight(combination):
"""Return True if the weight of the combination is within
the allowed limit"""
return sum(x[0] for x in combination) <= 200
def fees(combination):
"""Return the value of the combination to a miner"""
return sum(x[1] for x in combination)
def valid_combinations(mempool):
for i in range(len(mempool)):
for c in itertools.combinations(mempool, i):
if check_weight(c):
yield c
sorted(valid_combinations(mempool), key=fees, reverse=True)
[((100, 198), (11, 150), (40, 150), (43, 195)), ((11, 150), (40, 150), (95, 189), (43, 195)), ((11, 150), (40, 150), (69, 186), (43, 195)), ((11, 150), (40, 150), (99, 178), (43, 195)), ((11, 150), (40, 150), (49, 79), (51, 60), (43, 195)), ((50, 56), (11, 150), (40, 150), (49, 79), (43, 195)), ((11, 150), (49, 79), (95, 189), (43, 195)), ((50, 56), (11, 150), (40, 150), (51, 60), (43, 195)), ((11, 150), (49, 79), (69, 186), (43, 195)), ((11, 150), (69, 186), (43, 195), (63, 65)), ((11, 150), (95, 189), (51, 60), (43, 195)), ((11, 150), (69, 186), (51, 60), (43, 195)), ((50, 56), (11, 150), (95, 189), (43, 195)), ((50, 56), (11, 150), (69, 186), (43, 195)), ((100, 198), (11, 150), (40, 150), (49, 79)), ((11, 150), (40, 150), (49, 79), (43, 195)), ((11, 150), (40, 150), (49, 79), (95, 189)), ((11, 150), (40, 150), (49, 79), (69, 186)), ((11, 150), (40, 150), (43, 195), (63, 65)), ((11, 150), (40, 150), (49, 79), (99, 178)), ((11, 150), (40, 150), (51, 60), (43, 195)), ((50, 56), (11, 150), (40, 150), (43, 195)), ((11, 150), (40, 150), (69, 186), (63, 65)), ((11, 150), (40, 150), (95, 189), (51, 60)), ((11, 150), (40, 150), (69, 186), (51, 60)), ((50, 56), (11, 150), (40, 150), (95, 189)), ((100, 198), (11, 150), (43, 195)), ((100, 198), (40, 150), (43, 195)), ((50, 56), (11, 150), (40, 150), (69, 186)), ((100, 198), (11, 150), (69, 186)), ((11, 150), (95, 189), (43, 195)), ((40, 150), (95, 189), (43, 195)), ((50, 56), (11, 150), (40, 150), (99, 178)), ((11, 150), (69, 186), (43, 195)), ((40, 150), (69, 186), (43, 195)), ((11, 150), (69, 186), (95, 189)), ((11, 150), (99, 178), (43, 195)), ((40, 150), (99, 178), (43, 195)), ((11, 150), (69, 186), (99, 178)), ((100, 198), (11, 150), (40, 150)), ((11, 150), (40, 150), (43, 195)), ((11, 150), (144, 149), (43, 195)), ((11, 150), (140, 146), (43, 195)), ((11, 150), (40, 150), (95, 189)), ((11, 150), (49, 79), (43, 195), (63, 65)), ((40, 150), (49, 79), (43, 195), (63, 65)), ((11, 150), (40, 150), (69, 186)), ((11, 150), (49, 79), (51, 60), (43, 195)), ((40, 150), (49, 79), (51, 60), (43, 195)), ((50, 56), (11, 150), (49, 79), (43, 195)), ((50, 56), (40, 150), (49, 79), (43, 195)), ((11, 150), (49, 79), (69, 186), (63, 65)), ((11, 150), (40, 150), (99, 178)), ((11, 150), (49, 79), (69, 186), (51, 60)), ((100, 198), (49, 79), (43, 195)), ((50, 56), (11, 150), (49, 79), (69, 186)), ((11, 150), (51, 60), (43, 195), (63, 65)), ((40, 150), (51, 60), (43, 195), (63, 65)), ((50, 56), (11, 150), (43, 195), (63, 65)), ((50, 56), (40, 150), (43, 195), (63, 65)), ((49, 79), (95, 189), (43, 195)), ((50, 56), (11, 150), (51, 60), (43, 195)), ((50, 56), (40, 150), (51, 60), (43, 195)), ((11, 150), (69, 186), (51, 60), (63, 65)), ((49, 79), (69, 186), (43, 195)), ((50, 56), (11, 150), (69, 186), (63, 65)), ((11, 150), (149, 156), (40, 150)), ((100, 198), (51, 60), (43, 195)), ((49, 79), (99, 178), (43, 195)), ((50, 56), (11, 150), (69, 186), (51, 60)), ((100, 198), (50, 56), (43, 195)), ((11, 150), (40, 150), (144, 149)), ((11, 150), (40, 150), (140, 146)), ((69, 186), (43, 195), (63, 65)), ((95, 189), (51, 60), (43, 195)), ((11, 150), (40, 150), (49, 79), (63, 65)), ((69, 186), (51, 60), (43, 195)), ((50, 56), (95, 189), (43, 195)), ((11, 150), (40, 150), (49, 79), (51, 60)), ((50, 56), (69, 186), (43, 195)), ((50, 56), (11, 150), (40, 150), (49, 79)), ((51, 60), (99, 178), (43, 195)), ((50, 56), (99, 178), (43, 195)), ((100, 198), (11, 150), (49, 79)), ((100, 198), (40, 150), (49, 79)), ((11, 150), (40, 150), (51, 60), (63, 65)), ((11, 150), (49, 79), (43, 195)), ((40, 150), (49, 79), (43, 195)), ((50, 56), (11, 150), (40, 150), (63, 65)), ((11, 150), (49, 79), (95, 189)), ((40, 150), (49, 79), (95, 189)), ((50, 56), (11, 150), (40, 150), (51, 60)), ((11, 150), (49, 79), (69, 186)), ((40, 150), (49, 79), (69, 186)), ((100, 198), (11, 150), (63, 65)), ((11, 150), (43, 195), (63, 65)), ((40, 150), (43, 195), (63, 65)), ((100, 198), (11, 150), (51, 60)), ((100, 198), (40, 150), (51, 60)), ((11, 150), (49, 79), (99, 178)), ((40, 150), (49, 79), (99, 178)), ((11, 150), (51, 60), (43, 195)), ((40, 150), (51, 60), (43, 195)), ((100, 198), (50, 56), (11, 150)), ((100, 198), (50, 56), (40, 150)), ((11, 150), (95, 189), (63, 65)), ((40, 150), (95, 189), (63, 65)), ((50, 56), (11, 150), (43, 195)), ((50, 56), (40, 150), (43, 195)), ((11, 150), (69, 186), (63, 65)), ((40, 150), (69, 186), (63, 65)), ((11, 150), (95, 189), (51, 60)), ((40, 150), (95, 189), (51, 60)), ((11, 150), (69, 186), (51, 60)), ((40, 150), (69, 186), (51, 60)), ((50, 56), (11, 150), (95, 189)), ((50, 56), (40, 150), (95, 189)), ((154, 199), (43, 195)), ((100, 198), (43, 195)), ((11, 150), (99, 178), (63, 65)), ((50, 56), (11, 150), (69, 186)), ((50, 56), (40, 150), (69, 186)), ((50, 56), (49, 79), (51, 60), (43, 195)), ((11, 150), (51, 60), (99, 178)), ((40, 150), (51, 60), (99, 178)), ((100, 198), (95, 189)), ((100, 198), (69, 186)), ((95, 189), (43, 195)), ((50, 56), (11, 150), (99, 178)), ((50, 56), (40, 150), (99, 178)), ((11, 150), (130, 38), (43, 195)), ((69, 186), (43, 195)), ((11, 150), (40, 150), (49, 79)), ((100, 198), (99, 178)), ((69, 186), (95, 189)), ((11, 150), (140, 146), (49, 79)), ((99, 178), (43, 195)), ((95, 189), (99, 178)), ((11, 150), (40, 150), (63, 65)), ((69, 186), (99, 178)), ((11, 150), (40, 150), (51, 60)), ((50, 56), (11, 150), (40, 150)), ((11, 150), (49, 79), (51, 60), (63, 65)), ((149, 156), (43, 195)), ((50, 56), (11, 150), (49, 79), (63, 65)), ((11, 150), (154, 199)), ((40, 150), (154, 199)), ((100, 198), (11, 150)), ((100, 198), (40, 150)), ((11, 150), (43, 195)), ((40, 150), (43, 195)), ((50, 56), (11, 150), (49, 79), (51, 60)), ((50, 56), (40, 150), (49, 79), (51, 60)), ((144, 149), (43, 195)), ((140, 146), (43, 195)), ((11, 150), (95, 189)), ((40, 150), (95, 189)), ((49, 79), (43, 195), (63, 65)), ((11, 150), (40, 150), (130, 38)), ((100, 198), (49, 79), (51, 60)), ((11, 150), (69, 186)), ((40, 150), (69, 186)), ((49, 79), (51, 60), (43, 195)), ((100, 198), (50, 56), (49, 79)), ((50, 56), (11, 150), (51, 60), (63, 65)), ((50, 56), (49, 79), (43, 195)), ((49, 79), (69, 186), (63, 65)), ((11, 150), (99, 178)), ((40, 150), (99, 178)), ((49, 79), (95, 189), (51, 60)), ((49, 79), (69, 186), (51, 60)), ((50, 56), (49, 79), (95, 189)), ((50, 56), (49, 79), (69, 186)), ((51, 60), (43, 195), (63, 65)), ((49, 79), (51, 60), (99, 178)), ((50, 56), (43, 195), (63, 65)), ((50, 56), (49, 79), (99, 178)), ((50, 56), (51, 60), (43, 195)), ((69, 186), (51, 60), (63, 65)), ((50, 56), (69, 186), (63, 65)), ((11, 150), (149, 156)), ((149, 156), (40, 150)), ((50, 56), (95, 189), (51, 60)), ((50, 56), (69, 186), (51, 60)), ((11, 150), (40, 150)), ((11, 150), (144, 149)), ((40, 150), (144, 149)), ((11, 150), (140, 146)), ((40, 150), (140, 146)), ((50, 56), (51, 60), (99, 178)), ((11, 150), (49, 79), (63, 65)), ((40, 150), (49, 79), (63, 65)), ((11, 150), (49, 79), (51, 60)), ((40, 150), (49, 79), (51, 60)), ((50, 56), (11, 150), (49, 79)), ((50, 56), (40, 150), (49, 79)), ((100, 198), (49, 79)), ((11, 150), (51, 60), (63, 65)), ((40, 150), (51, 60), (63, 65)), ((49, 79), (43, 195)), ((50, 56), (11, 150), (63, 65)), ((50, 56), (40, 150), (63, 65)), ((49, 79), (95, 189)), ((11, 150), (49, 79), (130, 38)), ((50, 56), (11, 150), (51, 60)), ((50, 56), (40, 150), (51, 60)), ((49, 79), (69, 186)), ((100, 198), (63, 65)), ((43, 195), (63, 65)), ((100, 198), (51, 60)), ((49, 79), (99, 178)), ((51, 60), (43, 195)), ((100, 198), (50, 56)), ((95, 189), (63, 65)), ((50, 56), (43, 195)), ((69, 186), (63, 65)), ((95, 189), (51, 60)), ((11, 150), (130, 38), (51, 60)), ((69, 186), (51, 60)), ((151, 51), (43, 195)), ((50, 56), (95, 189)), ((11, 150), (172, 94)), ((50, 56), (11, 150), (130, 38)), ((99, 178), (63, 65)), ((50, 56), (69, 186)), ((51, 60), (99, 178)), ((149, 156), (49, 79)), ((50, 56), (99, 178)), ((130, 38), (43, 195)), ((11, 150), (49, 79)), ((40, 150), (49, 79)), ((144, 149), (49, 79)), ((140, 146), (49, 79)), ((69, 186), (130, 38)), ((149, 156), (51, 60)), ((11, 150), (63, 65)), ((40, 150), (63, 65)), ((50, 56), (149, 156)), ((11, 150), (51, 60)), ((40, 150), (51, 60)), ((144, 149), (51, 60)), ((50, 56), (11, 150)), ((50, 56), (40, 150)), ((140, 146), (51, 60)), ((50, 56), (144, 149)), ((49, 79), (51, 60), (63, 65)), ((50, 56), (140, 146)), ((11, 150), (151, 51)), ((40, 150), (151, 51)), ((50, 56), (49, 79), (63, 65)), ((154, 199),), ((100, 198),), ((43, 195),), ((50, 56), (49, 79), (51, 60)), ((95, 189),), ((11, 150), (130, 38)), ((40, 150), (130, 38)), ((196, 187),), ((69, 186),), ((50, 56), (51, 60), (63, 65)), ((99, 178),), ((11, 150), (185, 10)), ((149, 156),), ((11, 150),), ((40, 150),), ((144, 149),), ((140, 146),), ((49, 79), (63, 65)), ((49, 79), (51, 60)), ((50, 56), (49, 79)), ((49, 79), (151, 51)), ((51, 60), (63, 65)), ((50, 56), (63, 65)), ((49, 79), (130, 38)), ((50, 56), (51, 60)), ((130, 38), (63, 65)), ((130, 38), (51, 60)), ((172, 94),), ((50, 56), (130, 38)), ((49, 79),), ((63, 65),), ((51, 60),), ((50, 56),), ((151, 51),), ((130, 38),), ((185, 10),), ()]
fees(best := max(valid_combinations(mempool), key=fees))
693
best
((100, 198), (11, 150), (40, 150), (43, 195))
list(valid_combinations(mempool))
[(), ((100, 198),), ((50, 56),), ((11, 150),), ((149, 156),), ((40, 150),), ((144, 149),), ((140, 146),), ((185, 10),), ((49, 79),), ((69, 186),), ((130, 38),), ((95, 189),), ((51, 60),), ((99, 178),), ((151, 51),), ((196, 187),), ((154, 199),), ((43, 195),), ((63, 65),), ((172, 94),), ((100, 198), (50, 56)), ((100, 198), (11, 150)), ((100, 198), (40, 150)), ((100, 198), (49, 79)), ((100, 198), (69, 186)), ((100, 198), (95, 189)), ((100, 198), (51, 60)), ((100, 198), (99, 178)), ((100, 198), (43, 195)), ((100, 198), (63, 65)), ((50, 56), (11, 150)), ((50, 56), (149, 156)), ((50, 56), (40, 150)), ((50, 56), (144, 149)), ((50, 56), (140, 146)), ((50, 56), (49, 79)), ((50, 56), (69, 186)), ((50, 56), (130, 38)), ((50, 56), (95, 189)), ((50, 56), (51, 60)), ((50, 56), (99, 178)), ((50, 56), (43, 195)), ((50, 56), (63, 65)), ((11, 150), (149, 156)), ((11, 150), (40, 150)), ((11, 150), (144, 149)), ((11, 150), (140, 146)), ((11, 150), (185, 10)), ((11, 150), (49, 79)), ((11, 150), (69, 186)), ((11, 150), (130, 38)), ((11, 150), (95, 189)), ((11, 150), (51, 60)), ((11, 150), (99, 178)), ((11, 150), (151, 51)), ((11, 150), (154, 199)), ((11, 150), (43, 195)), ((11, 150), (63, 65)), ((11, 150), (172, 94)), ((149, 156), (40, 150)), ((149, 156), (49, 79)), ((149, 156), (51, 60)), ((149, 156), (43, 195)), ((40, 150), (144, 149)), ((40, 150), (140, 146)), ((40, 150), (49, 79)), ((40, 150), (69, 186)), ((40, 150), (130, 38)), ((40, 150), (95, 189)), ((40, 150), (51, 60)), ((40, 150), (99, 178)), ((40, 150), (151, 51)), ((40, 150), (154, 199)), ((40, 150), (43, 195)), ((40, 150), (63, 65)), ((144, 149), (49, 79)), ((144, 149), (51, 60)), ((144, 149), (43, 195)), ((140, 146), (49, 79)), ((140, 146), (51, 60)), ((140, 146), (43, 195)), ((49, 79), (69, 186)), ((49, 79), (130, 38)), ((49, 79), (95, 189)), ((49, 79), (51, 60)), ((49, 79), (99, 178)), ((49, 79), (151, 51)), ((49, 79), (43, 195)), ((49, 79), (63, 65)), ((69, 186), (130, 38)), ((69, 186), (95, 189)), ((69, 186), (51, 60)), ((69, 186), (99, 178)), ((69, 186), (43, 195)), ((69, 186), (63, 65)), ((130, 38), (51, 60)), ((130, 38), (43, 195)), ((130, 38), (63, 65)), ((95, 189), (51, 60)), ((95, 189), (99, 178)), ((95, 189), (43, 195)), ((95, 189), (63, 65)), ((51, 60), (99, 178)), ((51, 60), (43, 195)), ((51, 60), (63, 65)), ((99, 178), (43, 195)), ((99, 178), (63, 65)), ((151, 51), (43, 195)), ((154, 199), (43, 195)), ((43, 195), (63, 65)), ((100, 198), (50, 56), (11, 150)), ((100, 198), (50, 56), (40, 150)), ((100, 198), (50, 56), (49, 79)), ((100, 198), (50, 56), (43, 195)), ((100, 198), (11, 150), (40, 150)), ((100, 198), (11, 150), (49, 79)), ((100, 198), (11, 150), (69, 186)), ((100, 198), (11, 150), (51, 60)), ((100, 198), (11, 150), (43, 195)), ((100, 198), (11, 150), (63, 65)), ((100, 198), (40, 150), (49, 79)), ((100, 198), (40, 150), (51, 60)), ((100, 198), (40, 150), (43, 195)), ((100, 198), (49, 79), (51, 60)), ((100, 198), (49, 79), (43, 195)), ((100, 198), (51, 60), (43, 195)), ((50, 56), (11, 150), (40, 150)), ((50, 56), (11, 150), (49, 79)), ((50, 56), (11, 150), (69, 186)), ((50, 56), (11, 150), (130, 38)), ((50, 56), (11, 150), (95, 189)), ((50, 56), (11, 150), (51, 60)), ((50, 56), (11, 150), (99, 178)), ((50, 56), (11, 150), (43, 195)), ((50, 56), (11, 150), (63, 65)), ((50, 56), (40, 150), (49, 79)), ((50, 56), (40, 150), (69, 186)), ((50, 56), (40, 150), (95, 189)), ((50, 56), (40, 150), (51, 60)), ((50, 56), (40, 150), (99, 178)), ((50, 56), (40, 150), (43, 195)), ((50, 56), (40, 150), (63, 65)), ((50, 56), (49, 79), (69, 186)), ((50, 56), (49, 79), (95, 189)), ((50, 56), (49, 79), (51, 60)), ((50, 56), (49, 79), (99, 178)), ((50, 56), (49, 79), (43, 195)), ((50, 56), (49, 79), (63, 65)), ((50, 56), (69, 186), (51, 60)), ((50, 56), (69, 186), (43, 195)), ((50, 56), (69, 186), (63, 65)), ((50, 56), (95, 189), (51, 60)), ((50, 56), (95, 189), (43, 195)), ((50, 56), (51, 60), (99, 178)), ((50, 56), (51, 60), (43, 195)), ((50, 56), (51, 60), (63, 65)), ((50, 56), (99, 178), (43, 195)), ((50, 56), (43, 195), (63, 65)), ((11, 150), (149, 156), (40, 150)), ((11, 150), (40, 150), (144, 149)), ((11, 150), (40, 150), (140, 146)), ((11, 150), (40, 150), (49, 79)), ((11, 150), (40, 150), (69, 186)), ((11, 150), (40, 150), (130, 38)), ((11, 150), (40, 150), (95, 189)), ((11, 150), (40, 150), (51, 60)), ((11, 150), (40, 150), (99, 178)), ((11, 150), (40, 150), (43, 195)), ((11, 150), (40, 150), (63, 65)), ((11, 150), (144, 149), (43, 195)), ((11, 150), (140, 146), (49, 79)), ((11, 150), (140, 146), (43, 195)), ((11, 150), (49, 79), (69, 186)), ((11, 150), (49, 79), (130, 38)), ((11, 150), (49, 79), (95, 189)), ((11, 150), (49, 79), (51, 60)), ((11, 150), (49, 79), (99, 178)), ((11, 150), (49, 79), (43, 195)), ((11, 150), (49, 79), (63, 65)), ((11, 150), (69, 186), (95, 189)), ((11, 150), (69, 186), (51, 60)), ((11, 150), (69, 186), (99, 178)), ((11, 150), (69, 186), (43, 195)), ((11, 150), (69, 186), (63, 65)), ((11, 150), (130, 38), (51, 60)), ((11, 150), (130, 38), (43, 195)), ((11, 150), (95, 189), (51, 60)), ((11, 150), (95, 189), (43, 195)), ((11, 150), (95, 189), (63, 65)), ((11, 150), (51, 60), (99, 178)), ((11, 150), (51, 60), (43, 195)), ((11, 150), (51, 60), (63, 65)), ((11, 150), (99, 178), (43, 195)), ((11, 150), (99, 178), (63, 65)), ((11, 150), (43, 195), (63, 65)), ((40, 150), (49, 79), (69, 186)), ((40, 150), (49, 79), (95, 189)), ((40, 150), (49, 79), (51, 60)), ((40, 150), (49, 79), (99, 178)), ((40, 150), (49, 79), (43, 195)), ((40, 150), (49, 79), (63, 65)), ((40, 150), (69, 186), (51, 60)), ((40, 150), (69, 186), (43, 195)), ((40, 150), (69, 186), (63, 65)), ((40, 150), (95, 189), (51, 60)), ((40, 150), (95, 189), (43, 195)), ((40, 150), (95, 189), (63, 65)), ((40, 150), (51, 60), (99, 178)), ((40, 150), (51, 60), (43, 195)), ((40, 150), (51, 60), (63, 65)), ((40, 150), (99, 178), (43, 195)), ((40, 150), (43, 195), (63, 65)), ((49, 79), (69, 186), (51, 60)), ((49, 79), (69, 186), (43, 195)), ((49, 79), (69, 186), (63, 65)), ((49, 79), (95, 189), (51, 60)), ((49, 79), (95, 189), (43, 195)), ((49, 79), (51, 60), (99, 178)), ((49, 79), (51, 60), (43, 195)), ((49, 79), (51, 60), (63, 65)), ((49, 79), (99, 178), (43, 195)), ((49, 79), (43, 195), (63, 65)), ((69, 186), (51, 60), (43, 195)), ((69, 186), (51, 60), (63, 65)), ((69, 186), (43, 195), (63, 65)), ((95, 189), (51, 60), (43, 195)), ((51, 60), (99, 178), (43, 195)), ((51, 60), (43, 195), (63, 65)), ((100, 198), (11, 150), (40, 150), (49, 79)), ((100, 198), (11, 150), (40, 150), (43, 195)), ((50, 56), (11, 150), (40, 150), (49, 79)), ((50, 56), (11, 150), (40, 150), (69, 186)), ((50, 56), (11, 150), (40, 150), (95, 189)), ((50, 56), (11, 150), (40, 150), (51, 60)), ((50, 56), (11, 150), (40, 150), (99, 178)), ((50, 56), (11, 150), (40, 150), (43, 195)), ((50, 56), (11, 150), (40, 150), (63, 65)), ((50, 56), (11, 150), (49, 79), (69, 186)), ((50, 56), (11, 150), (49, 79), (51, 60)), ((50, 56), (11, 150), (49, 79), (43, 195)), ((50, 56), (11, 150), (49, 79), (63, 65)), ((50, 56), (11, 150), (69, 186), (51, 60)), ((50, 56), (11, 150), (69, 186), (43, 195)), ((50, 56), (11, 150), (69, 186), (63, 65)), ((50, 56), (11, 150), (95, 189), (43, 195)), ((50, 56), (11, 150), (51, 60), (43, 195)), ((50, 56), (11, 150), (51, 60), (63, 65)), ((50, 56), (11, 150), (43, 195), (63, 65)), ((50, 56), (40, 150), (49, 79), (51, 60)), ((50, 56), (40, 150), (49, 79), (43, 195)), ((50, 56), (40, 150), (51, 60), (43, 195)), ((50, 56), (40, 150), (43, 195), (63, 65)), ((50, 56), (49, 79), (51, 60), (43, 195)), ((11, 150), (40, 150), (49, 79), (69, 186)), ((11, 150), (40, 150), (49, 79), (95, 189)), ((11, 150), (40, 150), (49, 79), (51, 60)), ((11, 150), (40, 150), (49, 79), (99, 178)), ((11, 150), (40, 150), (49, 79), (43, 195)), ((11, 150), (40, 150), (49, 79), (63, 65)), ((11, 150), (40, 150), (69, 186), (51, 60)), ((11, 150), (40, 150), (69, 186), (43, 195)), ((11, 150), (40, 150), (69, 186), (63, 65)), ((11, 150), (40, 150), (95, 189), (51, 60)), ((11, 150), (40, 150), (95, 189), (43, 195)), ((11, 150), (40, 150), (51, 60), (43, 195)), ((11, 150), (40, 150), (51, 60), (63, 65)), ((11, 150), (40, 150), (99, 178), (43, 195)), ((11, 150), (40, 150), (43, 195), (63, 65)), ((11, 150), (49, 79), (69, 186), (51, 60)), ((11, 150), (49, 79), (69, 186), (43, 195)), ((11, 150), (49, 79), (69, 186), (63, 65)), ((11, 150), (49, 79), (95, 189), (43, 195)), ((11, 150), (49, 79), (51, 60), (43, 195)), ((11, 150), (49, 79), (51, 60), (63, 65)), ((11, 150), (49, 79), (43, 195), (63, 65)), ((11, 150), (69, 186), (51, 60), (43, 195)), ((11, 150), (69, 186), (51, 60), (63, 65)), ((11, 150), (69, 186), (43, 195), (63, 65)), ((11, 150), (95, 189), (51, 60), (43, 195)), ((11, 150), (51, 60), (43, 195), (63, 65)), ((40, 150), (49, 79), (51, 60), (43, 195)), ((40, 150), (49, 79), (43, 195), (63, 65)), ((40, 150), (51, 60), (43, 195), (63, 65)), ((50, 56), (11, 150), (40, 150), (49, 79), (43, 195)), ((50, 56), (11, 150), (40, 150), (51, 60), (43, 195)), ((11, 150), (40, 150), (49, 79), (51, 60), (43, 195))]
fees(((100, 198),)) > fees(((95, 189),))
True
sum([[list(c)]
for i in range(4)
for c in itertools.combinations(range(3), i) ], [])
[[], [0], [1], [2], [0, 1], [0, 2], [1, 2], [0, 1, 2]]
# len: 2 => 2^2
# len: 3 => 8 == 2^3
# len: 4 => 2^4
# ...
# len: n => 2^n
2**20
1024