broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(lineup, points, salaries, teams, cap):
    cpt, flex = lineup['CPT'], lineup['FLEX']
    names = [cpt] + flex
    cpt_salary = -(-salaries[cpt] * 3 // 200) * 100
    salary = cpt_salary + sum(salaries[p] for p in flex)
    c = points[cpt] * 3
    cpt_pts = (abs(c) + 1) // 2 * (1 if c >= 0 else -1)
    total = cpt_pts + sum(points[p] for p in flex)
    if len(flex) != 5 or len(set(names)) != 6:
        return {'valid': False, 'reason': 'roster', 'salary': salary, 'points': total}
    if salary >= cap:
        return {'valid': False, 'reason': 'cap', 'salary': salary, 'points': total}
    if len({teams[p] for p in names}) < 2:
        return {'valid': False, 'reason': 'teams', 'salary': salary, 'points': total}
    return {'valid': True, 'reason': None, 'salary': salary, 'points': total}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: salary cap boundary',
   [{'CPT': 'f', 'FLEX': ['h', 'e', 'a', 'c', 'd']},
    {'a': 1791, 'b': 12, 'c': 2001, 'd': 225, 'e': 1833, 'f': -45, 'g': -45, 'h': 225},
    {'a': 9900, 'b': 3300, 'c': 8700, 'd': 9900, 'e': 8700, 'f': 7100, 'g': 5300, 'h': 5500},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'H'}, 53400],
   {'points': 6007, 'reason': None, 'salary': 53400, 'valid': True}),
  ('partial repair probe: salary cap boundary',
   [{'CPT': 'e', 'FLEX': ['c', 'd', 'f', 'g', 'h']},
    {'a': -45, 'b': 2001, 'c': 2001, 'd': 1795, 'e': 0, 'f': 2763, 'g': 225, 'h': 1566},
    {'a': 9900, 'b': 7100, 'c': 8700, 'd': 7100, 'e': 9900, 'f': 5500, 'g': 10500, 'h': 7100},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 8350, 'reason': 'cap', 'salary': 53800, 'valid': False}),
  ('second regression',
   [{'CPT': 'f', 'FLEX': ['c', 'a', 'd', 'g', 'b']},
    {'a': 1795, 'b': 225, 'c': -50, 'd': 1333, 'e': 0, 'f': 2256, 'g': 1333, 'h': 2001},
    {'a': 8700, 'b': 9900, 'c': 9900, 'd': 9900, 'e': 5500, 'f': 10500, 'g': 5300, 'h': 3300},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'A'}, 59500],
   {'points': 8020, 'reason': None, 'salary': 59500, 'valid': True}),
  ('normal control 1',
   [{'CPT': 'f', 'FLEX': ['d', 'a', 'f', 'b', 'e']},
    {'a': 1795, 'b': 1795, 'c': -50, 'd': 2001, 'e': 0, 'f': -50, 'g': -50, 'h': -45},
    {'a': 3300, 'b': 8700, 'c': 8700, 'd': 8700, 'e': 8700, 'f': 5500, 'g': 5500, 'h': 3300},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 5466, 'reason': 'roster', 'salary': 43200, 'valid': False}),
  ('normal control 2',
   [{'CPT': 'c', 'FLEX': ['b', 'f', 'e', 'a', 'h']},
    {'a': 1795, 'b': 2001, 'c': 225, 'd': -45, 'e': 2001, 'f': -45, 'g': 225, 'h': 225},
    {'a': 9900, 'b': 10500, 'c': 5300, 'd': 5500, 'e': 8700, 'f': 5300, 'g': 5300, 'h': 8700},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 51200],
   {'points': 6315, 'reason': None, 'salary': 51100, 'valid': True}),
  ('normal control 3',
   [{'CPT': 'h', 'FLEX': ['g', 'h', 'b', 'a', 'h']},
    {'a': 0, 'b': -50, 'c': -50, 'd': 2590, 'e': 225, 'f': 176, 'g': 225, 'h': 0},
    {'a': 3300, 'b': 9900, 'c': 3300, 'd': 8700, 'e': 5300, 'f': 3300, 'g': 9900, 'h': 7100},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'A'}, 48100],
   {'points': 175, 'reason': 'roster', 'salary': 48000, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'd', 'FLEX': ['e', 'a', 'b', 'c', 'g']},
    {'a': 2001, 'b': 1333, 'c': -45, 'd': 225, 'e': -50, 'f': 1333, 'g': -45, 'h': 0},
    {'a': 9900, 'b': 10500, 'c': 8700, 'd': 7100, 'e': 3300, 'f': 5300, 'g': 5500, 'h': 3300},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 50000],
   {'points': 3532, 'reason': None, 'salary': 48600, 'valid': True})],
 [('regression: salary cap boundary',
   [{'CPT': 'g', 'FLEX': ['f', 'e', 'a', 'c', 'd']},
    {'a': 1795, 'b': 628, 'c': 2001, 'd': -50, 'e': 1333, 'f': 1333, 'g': -45, 'h': 2835},
    {'a': 5300, 'b': 7100, 'c': 10500, 'd': 9900, 'e': 5300, 'f': 5500, 'g': 8700, 'h': 5300},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 49600],
   {'points': 6344, 'reason': None, 'salary': 49600, 'valid': True}),
  ('partial repair probe: salary cap boundary',
   [{'CPT': 'g', 'FLEX': ['e', 'c', 'b', 'd', 'a']},
    {'a': 2241, 'b': 1664, 'c': 2001, 'd': 225, 'e': 1795, 'f': 2184, 'g': 225, 'h': 225},
    {'a': 5300, 'b': 9900, 'c': 8700, 'd': 8700, 'e': 5300, 'f': 5500, 'g': 8700, 'h': 7100},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 50000],
   {'points': 8264, 'reason': 'cap', 'salary': 51000, 'valid': False}),
  ('second regression',
   [{'CPT': 'c', 'FLEX': ['f', 'h', 'd', 'e', 'g']},
    {'a': 0, 'b': 2001, 'c': 0, 'd': -50, 'e': 1333, 'f': -45, 'g': 1795, 'h': 2001},
    {'a': 8700, 'b': 10500, 'c': 5500, 'd': 8700, 'e': 5500, 'f': 7100, 'g': 10500, 'h': 7100},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 47100],
   {'points': 5034, 'reason': 'cap', 'salary': 47200, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'b', 'FLEX': ['d', 'f', 'b', 'h', 'g']},
    {'a': 225, 'b': 2001, 'c': 2001, 'd': 1333, 'e': -50, 'f': 0, 'g': 2001, 'h': 1333},
    {'a': 9900, 'b': 9900, 'c': 3300, 'd': 3300, 'e': 5500, 'f': 3300, 'g': 8700, 'h': 5300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'A'}, 50000],
   {'points': 9670, 'reason': 'roster', 'salary': 45400, 'valid': False}),
  ('normal control 2',
   [{'CPT': 'd', 'FLEX': ['f', 'a', 'c', 'd', 'b']},
    {'a': -45, 'b': -45, 'c': 0, 'd': -50, 'e': -94, 'f': 2001, 'g': 225, 'h': -50},
    {'a': 7100, 'b': 5300, 'c': 3300, 'd': 3300, 'e': 3300, 'f': 7100, 'g': 5300, 'h': 10500},
    {'a': 'A', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 31000],
   {'points': 1786, 'reason': 'roster', 'salary': 31100, 'valid': False}),
  ('normal control 3',
   [{'CPT': 'e', 'FLEX': ['g', 'a', 'e', 'c', 'h']},
    {'a': -45, 'b': -50, 'c': 225, 'd': -50, 'e': 0, 'f': -50, 'g': 0, 'h': 0},
    {'a': 5300, 'b': 9900, 'c': 5500, 'd': 10500, 'e': 10500, 'f': 10500, 'g': 10500, 'h': 5300},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'A'}, 50000],
   {'points': 180, 'reason': 'roster', 'salary': 52900, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'f', 'FLEX': ['e', 'c', 'f', 'd', 'b']},
    {'a': -45, 'b': 532, 'c': 0, 'd': 2001, 'e': 0, 'f': -50, 'g': 1385, 'h': -50},
    {'a': 9900, 'b': 5500, 'c': 8700, 'd': 3300, 'e': 7100, 'f': 9900, 'g': 8700, 'h': 9900},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 49400],
   {'points': 2408, 'reason': 'roster', 'salary': 49400, 'valid': False})],
 [('regression: salary cap boundary',
   [{'CPT': 'h', 'FLEX': ['c', 'd', 'a', 'e', 'f']},
    {'a': 225, 'b': 225, 'c': 225, 'd': 2690, 'e': 0, 'f': 1333, 'g': 332, 'h': 1333},
    {'a': 5300, 'b': 3300, 'c': 9900, 'd': 8700, 'e': 8700, 'f': 9900, 'g': 9900, 'h': 8700},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'A'}, 55600],
   {'points': 6473, 'reason': None, 'salary': 55600, 'valid': True}),
  ('partial repair probe: salary cap boundary',
   [{'CPT': 'b', 'FLEX': ['c', 'a', 'g', 'e', 'h']},
    {'a': -45, 'b': -45, 'c': -50, 'd': -45, 'e': 325, 'f': 225, 'g': 1333, 'h': 2279},
    {'a': 9900, 'b': 8700, 'c': 5300, 'd': 5500, 'e': 10500, 'f': 3300, 'g': 7100, 'h': 5500},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'A'}, 51300],
   {'points': 3774, 'reason': 'cap', 'salary': 51400, 'valid': False}),
  ('second regression',
   [{'CPT': 'h', 'FLEX': ['a', 'g', 'd', 'f', 'b']},
    {'a': -50, 'b': 1333, 'c': 1795, 'd': -50, 'e': -50, 'f': 0, 'g': 741, 'h': -50},
    {'a': 9900, 'b': 9900, 'c': 8700, 'd': 3300, 'e': 3300, 'f': 7100, 'g': 9900, 'h': 5500},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 48300],
   {'points': 1899, 'reason': 'cap', 'salary': 48400, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'h', 'FLEX': ['f', 'c', 'h', 'b']},
    {'a': 2001, 'b': 2001, 'c': -45, 'd': 439, 'e': 2001, 'f': 1333, 'g': 225, 'h': 0},
    {'a': 10500, 'b': 9900, 'c': 9900, 'd': 3300, 'e': 9900, 'f': 8700, 'g': 5500, 'h': 5300},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'H'}, 41900],
   {'points': 3289, 'reason': 'roster', 'salary': 41800, 'valid': False}),
  ('normal control 2',
   [{'CPT': 'h', 'FLEX': ['c', 'd', 'h', 'f']},
    {'a': 2001, 'b': 1333, 'c': 1795, 'd': 1795, 'e': 0, 'f': 2915, 'g': 2001, 'h': -45},
    {'a': 3300, 'b': 10500, 'c': 5300, 'd': 10500, 'e': 5500, 'f': 10500, 'g': 7100, 'h': 9900},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 51000],
   {'points': 6392, 'reason': 'roster', 'salary': 51100, 'valid': False}),
  ('normal control 3',
   [{'CPT': 'c', 'FLEX': ['a', 'h', 'f', 'd', 'g']},
    {'a': 2001, 'b': -45, 'c': 1333, 'd': 2807, 'e': 0, 'f': 1333, 'g': -45, 'h': 1333},
    {'a': 10500, 'b': 3300, 'c': 10500, 'd': 5500, 'e': 5300, 'f': 10500, 'g': 8700, 'h': 5500},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 9429, 'reason': 'cap', 'salary': 56500, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'c', 'FLEX': ['h', 'f', 'g', 'c', 'e']},
    {'a': 1333, 'b': -45, 'c': -50, 'd': -45, 'e': 1333, 'f': -45, 'g': 1795, 'h': -50},
    {'a': 5500, 'b': 5500, 'c': 10500, 'd': 9900, 'e': 5300, 'f': 7100, 'g': 3300, 'h': 10500},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 52400],
   {'points': 2908, 'reason': 'roster', 'salary': 52500, 'valid': False})],
 [('regression: salary cap boundary',
   [{'CPT': 'h', 'FLEX': ['a', 'c', 'e', 'd', 'f']},
    {'a': 2001, 'b': -45, 'c': 225, 'd': 225, 'e': 1580, 'f': -50, 'g': -45, 'h': 0},
    {'a': 3300, 'b': 7100, 'c': 8700, 'd': 8700, 'e': 10500, 'f': 5500, 'g': 5300, 'h': 5500},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 45000],
   {'points': 3981, 'reason': 'teams', 'salary': 45000, 'valid': False}),
  ('partial repair probe: salary cap boundary',
   [{'CPT': 'b', 'FLEX': ['g', 'e', 'f', 'c', 'a']},
    {'a': 1333, 'b': -50, 'c': 225, 'd': 1333, 'e': 1333, 'f': 225, 'g': 1795, 'h': 1795},
    {'a': 10500, 'b': 5500, 'c': 5300, 'd': 8700, 'e': 8700, 'f': 10500, 'g': 7100, 'h': 3300},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 4836, 'reason': 'cap', 'salary': 50400, 'valid': False}),
  ('second regression',
   [{'CPT': 'c', 'FLEX': ['h', 'f', 'd', 'g', 'a']},
    {'a': -45, 'b': -45, 'c': 1333, 'd': 2001, 'e': 0, 'f': 225, 'g': -45, 'h': 2001},
    {'a': 10500, 'b': 7100, 'c': 5500, 'd': 5500, 'e': 7100, 'f': 7100, 'g': 7100, 'h': 5300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 43700],
   {'points': 6137, 'reason': 'cap', 'salary': 43800, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'g', 'FLEX': ['b', 'a', 'g', 'e', 'd']},
    {'a': 1333, 'b': -50, 'c': 0, 'd': 1551, 'e': 2001, 'f': 2001, 'g': -50, 'h': 1030},
    {'a': 10500, 'b': 9900, 'c': 5300, 'd': 5300, 'e': 8700, 'f': 5500, 'g': 10500, 'h': 5300},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 60600],
   {'points': 4710, 'reason': 'roster', 'salary': 60700, 'valid': False}),
  ('normal control 2',
   [{'CPT': 'f', 'FLEX': ['h', 'f', 'e', 'a', 'c']},
    {'a': 169, 'b': 2001, 'c': 0, 'd': 1333, 'e': -45, 'f': 2001, 'g': 2001, 'h': -45},
    {'a': 5500, 'b': 5300, 'c': 7100, 'd': 8700, 'e': 8700, 'f': 3300, 'g': 8700, 'h': 5300},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 50000],
   {'points': 5082, 'reason': 'roster', 'salary': 34900, 'valid': False}),
  ('normal control 3',
   [{'CPT': 'e', 'FLEX': ['d', 'g', 'a', 'h']},
    {'a': 0, 'b': 1020, 'c': 2001, 'd': 0, 'e': 2001, 'f': -45, 'g': -50, 'h': 225},
    {'a': 7100, 'b': 9900, 'c': 5500, 'd': 8700, 'e': 5500, 'f': 7100, 'g': 5300, 'h': 8700},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 50000],
   {'points': 3177, 'reason': 'roster', 'salary': 38100, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'd', 'FLEX': ['h', 'a', 'c', 'g', 'b']},
    {'a': 225, 'b': 2001, 'c': 1333, 'd': 0, 'e': -45, 'f': 2498, 'g': 1795, 'h': 225},
    {'a': 7100, 'b': 8700, 'c': 3300, 'd': 10500, 'e': 5300, 'f': 10500, 'g': 5300, 'h': 7100},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 47400],
   {'points': 5579, 'reason': None, 'salary': 47300, 'valid': True})],
 [('regression: salary cap boundary',
   [{'CPT': 'a', 'FLEX': ['g', 'e', 'd', 'c', 'h']},
    {'a': 0, 'b': -50, 'c': 1108, 'd': 225, 'e': 2524, 'f': 1333, 'g': 1795, 'h': -45},
    {'a': 10500, 'b': 5300, 'c': 5300, 'd': 10500, 'e': 5500, 'f': 7100, 'g': 3300, 'h': 5300},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'A'}, 45700],
   {'points': 5607, 'reason': None, 'salary': 45700, 'valid': True}),
  ('partial repair probe: salary cap boundary',
   [{'CPT': 'a', 'FLEX': ['h', 'g', 'b', 'e', 'd']},
    {'a': 2105, 'b': 1333, 'c': 1333, 'd': 1333, 'e': -45, 'f': -40, 'g': 1795, 'h': 2051},
    {'a': 5300, 'b': 7100, 'c': 7100, 'd': 8700, 'e': 7100, 'f': 7100, 'g': 10500, 'h': 5500},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 46800],
   {'points': 9625, 'reason': 'cap', 'salary': 46900, 'valid': False}),
  ('second regression',
   [{'CPT': 'b', 'FLEX': ['g', 'f', 'c', 'h', 'd']},
    {'a': -45, 'b': -45, 'c': -45, 'd': 225, 'e': 1333, 'f': 0, 'g': 1333, 'h': 376},
    {'a': 5500, 'b': 7100, 'c': 9900, 'd': 10500, 'e': 7100, 'f': 9900, 'g': 9900, 'h': 3300},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 54200],
   {'points': 1821, 'reason': None, 'salary': 54200, 'valid': True}),
  ('normal control 1',
   [{'CPT': 'c', 'FLEX': ['f', 'h', 'b', 'c', 'e']},
    {'a': 1795, 'b': 225, 'c': -45, 'd': 0, 'e': 2001, 'f': 225, 'g': 225, 'h': 1745},
    {'a': 8700, 'b': 3300, 'c': 5300, 'd': 3300, 'e': 3300, 'f': 5500, 'g': 3300, 'h': 7100},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 32600],
   {'points': 4083, 'reason': 'roster', 'salary': 32500, 'valid': False}),
  ('normal control 2',
   [{'CPT': 'c', 'FLEX': ['h', 'b', 'a', 'd', 'c']},
    {'a': 0, 'b': 0, 'c': -45, 'd': 225, 'e': -50, 'f': 2001, 'g': 1795, 'h': 225},
    {'a': 3300, 'b': 3300, 'c': 7100, 'd': 3300, 'e': 9900, 'f': 3300, 'g': 7100, 'h': 7100},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 34900],
   {'points': 337, 'reason': 'roster', 'salary': 34800, 'valid': False}),
  ('normal control 3',
   [{'CPT': 'h', 'FLEX': ['e', 'b', 'f', 'h']},
    {'a': 225, 'b': 940, 'c': 769, 'd': 0, 'e': -50, 'f': 1795, 'g': -45, 'h': 1333},
    {'a': 5500, 'b': 8700, 'c': 10500, 'd': 5500, 'e': 10500, 'f': 10500, 'g': 3300, 'h': 3300},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 38000],
   {'points': 6018, 'reason': 'roster', 'salary': 38000, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'f', 'FLEX': ['c', 'h', 'd', 'e', 'f']},
    {'a': 0, 'b': 1681, 'c': -45, 'd': 0, 'e': 1333, 'f': 2001, 'g': -50, 'h': 0},
    {'a': 3300, 'b': 3300, 'c': 9900, 'd': 9900, 'e': 5300, 'f': 9900, 'g': 3300, 'h': 7100},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 50000],
   {'points': 6291, 'reason': 'roster', 'salary': 57000, 'valid': False})]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(lineup, points, salaries, teams, cap):
    cpt, flex = lineup['CPT'], lineup['FLEX']
    names = [cpt] + flex
    cpt_salary = -(-salaries[cpt] * 3 // 200) * 100
    salary = cpt_salary + sum(salaries[p] for p in flex)
    c = points[cpt] * 3
    cpt_pts = (abs(c) + 1) // 2 * (1 if c >= 0 else -1)
    total = cpt_pts + sum(points[p] for p in flex)
    if len(flex) != 5 or len(set(names)) != 6:
        return {'valid': False, 'reason': 'roster', 'salary': salary, 'points': total}
    if salary - cpt_salary + salaries[cpt] > cap:
        return {'valid': False, 'reason': 'cap', 'salary': salary, 'points': total}
    if len({teams[p] for p in names}) < 2:
        return {'valid': False, 'reason': 'teams', 'salary': salary, 'points': total}
    return {'valid': True, 'reason': None, 'salary': salary, 'points': total}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: salary cap boundary',
   [{'CPT': 'f', 'FLEX': ['h', 'e', 'a', 'c', 'd']},
    {'a': 1791, 'b': 12, 'c': 2001, 'd': 225, 'e': 1833, 'f': -45, 'g': -45, 'h': 225},
    {'a': 9900, 'b': 3300, 'c': 8700, 'd': 9900, 'e': 8700, 'f': 7100, 'g': 5300, 'h': 5500},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'H'}, 53400],
   {'points': 6007, 'reason': None, 'salary': 53400, 'valid': True}),
  ('partial repair probe: salary cap boundary',
   [{'CPT': 'e', 'FLEX': ['c', 'd', 'f', 'g', 'h']},
    {'a': -45, 'b': 2001, 'c': 2001, 'd': 1795, 'e': 0, 'f': 2763, 'g': 225, 'h': 1566},
    {'a': 9900, 'b': 7100, 'c': 8700, 'd': 7100, 'e': 9900, 'f': 5500, 'g': 10500, 'h': 7100},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 8350, 'reason': 'cap', 'salary': 53800, 'valid': False}),
  ('second regression',
   [{'CPT': 'f', 'FLEX': ['c', 'a', 'd', 'g', 'b']},
    {'a': 1795, 'b': 225, 'c': -50, 'd': 1333, 'e': 0, 'f': 2256, 'g': 1333, 'h': 2001},
    {'a': 8700, 'b': 9900, 'c': 9900, 'd': 9900, 'e': 5500, 'f': 10500, 'g': 5300, 'h': 3300},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'A'}, 59500],
   {'points': 8020, 'reason': None, 'salary': 59500, 'valid': True}),
  ('normal control 1',
   [{'CPT': 'f', 'FLEX': ['d', 'a', 'f', 'b', 'e']},
    {'a': 1795, 'b': 1795, 'c': -50, 'd': 2001, 'e': 0, 'f': -50, 'g': -50, 'h': -45},
    {'a': 3300, 'b': 8700, 'c': 8700, 'd': 8700, 'e': 8700, 'f': 5500, 'g': 5500, 'h': 3300},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 5466, 'reason': 'roster', 'salary': 43200, 'valid': False}),
  ('normal control 2',
   [{'CPT': 'c', 'FLEX': ['b', 'f', 'e', 'a', 'h']},
    {'a': 1795, 'b': 2001, 'c': 225, 'd': -45, 'e': 2001, 'f': -45, 'g': 225, 'h': 225},
    {'a': 9900, 'b': 10500, 'c': 5300, 'd': 5500, 'e': 8700, 'f': 5300, 'g': 5300, 'h': 8700},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 51200],
   {'points': 6315, 'reason': None, 'salary': 51100, 'valid': True}),
  ('normal control 3',
   [{'CPT': 'h', 'FLEX': ['g', 'h', 'b', 'a', 'h']},
    {'a': 0, 'b': -50, 'c': -50, 'd': 2590, 'e': 225, 'f': 176, 'g': 225, 'h': 0},
    {'a': 3300, 'b': 9900, 'c': 3300, 'd': 8700, 'e': 5300, 'f': 3300, 'g': 9900, 'h': 7100},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'A'}, 48100],
   {'points': 175, 'reason': 'roster', 'salary': 48000, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'd', 'FLEX': ['e', 'a', 'b', 'c', 'g']},
    {'a': 2001, 'b': 1333, 'c': -45, 'd': 225, 'e': -50, 'f': 1333, 'g': -45, 'h': 0},
    {'a': 9900, 'b': 10500, 'c': 8700, 'd': 7100, 'e': 3300, 'f': 5300, 'g': 5500, 'h': 3300},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 50000],
   {'points': 3532, 'reason': None, 'salary': 48600, 'valid': True})],
 [('regression: salary cap boundary',
   [{'CPT': 'g', 'FLEX': ['f', 'e', 'a', 'c', 'd']},
    {'a': 1795, 'b': 628, 'c': 2001, 'd': -50, 'e': 1333, 'f': 1333, 'g': -45, 'h': 2835},
    {'a': 5300, 'b': 7100, 'c': 10500, 'd': 9900, 'e': 5300, 'f': 5500, 'g': 8700, 'h': 5300},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 49600],
   {'points': 6344, 'reason': None, 'salary': 49600, 'valid': True}),
  ('partial repair probe: salary cap boundary',
   [{'CPT': 'g', 'FLEX': ['e', 'c', 'b', 'd', 'a']},
    {'a': 2241, 'b': 1664, 'c': 2001, 'd': 225, 'e': 1795, 'f': 2184, 'g': 225, 'h': 225},
    {'a': 5300, 'b': 9900, 'c': 8700, 'd': 8700, 'e': 5300, 'f': 5500, 'g': 8700, 'h': 7100},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 50000],
   {'points': 8264, 'reason': 'cap', 'salary': 51000, 'valid': False}),
  ('second regression',
   [{'CPT': 'c', 'FLEX': ['f', 'h', 'd', 'e', 'g']},
    {'a': 0, 'b': 2001, 'c': 0, 'd': -50, 'e': 1333, 'f': -45, 'g': 1795, 'h': 2001},
    {'a': 8700, 'b': 10500, 'c': 5500, 'd': 8700, 'e': 5500, 'f': 7100, 'g': 10500, 'h': 7100},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 47100],
   {'points': 5034, 'reason': 'cap', 'salary': 47200, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'b', 'FLEX': ['d', 'f', 'b', 'h', 'g']},
    {'a': 225, 'b': 2001, 'c': 2001, 'd': 1333, 'e': -50, 'f': 0, 'g': 2001, 'h': 1333},
    {'a': 9900, 'b': 9900, 'c': 3300, 'd': 3300, 'e': 5500, 'f': 3300, 'g': 8700, 'h': 5300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'A'}, 50000],
   {'points': 9670, 'reason': 'roster', 'salary': 45400, 'valid': False}),
  ('normal control 2',
   [{'CPT': 'd', 'FLEX': ['f', 'a', 'c', 'd', 'b']},
    {'a': -45, 'b': -45, 'c': 0, 'd': -50, 'e': -94, 'f': 2001, 'g': 225, 'h': -50},
    {'a': 7100, 'b': 5300, 'c': 3300, 'd': 3300, 'e': 3300, 'f': 7100, 'g': 5300, 'h': 10500},
    {'a': 'A', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 31000],
   {'points': 1786, 'reason': 'roster', 'salary': 31100, 'valid': False}),
  ('normal control 3',
   [{'CPT': 'e', 'FLEX': ['g', 'a', 'e', 'c', 'h']},
    {'a': -45, 'b': -50, 'c': 225, 'd': -50, 'e': 0, 'f': -50, 'g': 0, 'h': 0},
    {'a': 5300, 'b': 9900, 'c': 5500, 'd': 10500, 'e': 10500, 'f': 10500, 'g': 10500, 'h': 5300},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'A'}, 50000],
   {'points': 180, 'reason': 'roster', 'salary': 52900, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'f', 'FLEX': ['e', 'c', 'f', 'd', 'b']},
    {'a': -45, 'b': 532, 'c': 0, 'd': 2001, 'e': 0, 'f': -50, 'g': 1385, 'h': -50},
    {'a': 9900, 'b': 5500, 'c': 8700, 'd': 3300, 'e': 7100, 'f': 9900, 'g': 8700, 'h': 9900},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 49400],
   {'points': 2408, 'reason': 'roster', 'salary': 49400, 'valid': False})],
 [('regression: salary cap boundary',
   [{'CPT': 'h', 'FLEX': ['c', 'd', 'a', 'e', 'f']},
    {'a': 225, 'b': 225, 'c': 225, 'd': 2690, 'e': 0, 'f': 1333, 'g': 332, 'h': 1333},
    {'a': 5300, 'b': 3300, 'c': 9900, 'd': 8700, 'e': 8700, 'f': 9900, 'g': 9900, 'h': 8700},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'A'}, 55600],
   {'points': 6473, 'reason': None, 'salary': 55600, 'valid': True}),
  ('partial repair probe: salary cap boundary',
   [{'CPT': 'b', 'FLEX': ['c', 'a', 'g', 'e', 'h']},
    {'a': -45, 'b': -45, 'c': -50, 'd': -45, 'e': 325, 'f': 225, 'g': 1333, 'h': 2279},
    {'a': 9900, 'b': 8700, 'c': 5300, 'd': 5500, 'e': 10500, 'f': 3300, 'g': 7100, 'h': 5500},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'A'}, 51300],
   {'points': 3774, 'reason': 'cap', 'salary': 51400, 'valid': False}),
  ('second regression',
   [{'CPT': 'h', 'FLEX': ['a', 'g', 'd', 'f', 'b']},
    {'a': -50, 'b': 1333, 'c': 1795, 'd': -50, 'e': -50, 'f': 0, 'g': 741, 'h': -50},
    {'a': 9900, 'b': 9900, 'c': 8700, 'd': 3300, 'e': 3300, 'f': 7100, 'g': 9900, 'h': 5500},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 48300],
   {'points': 1899, 'reason': 'cap', 'salary': 48400, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'h', 'FLEX': ['f', 'c', 'h', 'b']},
    {'a': 2001, 'b': 2001, 'c': -45, 'd': 439, 'e': 2001, 'f': 1333, 'g': 225, 'h': 0},
    {'a': 10500, 'b': 9900, 'c': 9900, 'd': 3300, 'e': 9900, 'f': 8700, 'g': 5500, 'h': 5300},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'H'}, 41900],
   {'points': 3289, 'reason': 'roster', 'salary': 41800, 'valid': False}),
  ('normal control 2',
   [{'CPT': 'h', 'FLEX': ['c', 'd', 'h', 'f']},
    {'a': 2001, 'b': 1333, 'c': 1795, 'd': 1795, 'e': 0, 'f': 2915, 'g': 2001, 'h': -45},
    {'a': 3300, 'b': 10500, 'c': 5300, 'd': 10500, 'e': 5500, 'f': 10500, 'g': 7100, 'h': 9900},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 51000],
   {'points': 6392, 'reason': 'roster', 'salary': 51100, 'valid': False}),
  ('normal control 3',
   [{'CPT': 'c', 'FLEX': ['a', 'h', 'f', 'd', 'g']},
    {'a': 2001, 'b': -45, 'c': 1333, 'd': 2807, 'e': 0, 'f': 1333, 'g': -45, 'h': 1333},
    {'a': 10500, 'b': 3300, 'c': 10500, 'd': 5500, 'e': 5300, 'f': 10500, 'g': 8700, 'h': 5500},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 9429, 'reason': 'cap', 'salary': 56500, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'c', 'FLEX': ['h', 'f', 'g', 'c', 'e']},
    {'a': 1333, 'b': -45, 'c': -50, 'd': -45, 'e': 1333, 'f': -45, 'g': 1795, 'h': -50},
    {'a': 5500, 'b': 5500, 'c': 10500, 'd': 9900, 'e': 5300, 'f': 7100, 'g': 3300, 'h': 10500},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 52400],
   {'points': 2908, 'reason': 'roster', 'salary': 52500, 'valid': False})],
 [('regression: salary cap boundary',
   [{'CPT': 'h', 'FLEX': ['a', 'c', 'e', 'd', 'f']},
    {'a': 2001, 'b': -45, 'c': 225, 'd': 225, 'e': 1580, 'f': -50, 'g': -45, 'h': 0},
    {'a': 3300, 'b': 7100, 'c': 8700, 'd': 8700, 'e': 10500, 'f': 5500, 'g': 5300, 'h': 5500},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 45000],
   {'points': 3981, 'reason': 'teams', 'salary': 45000, 'valid': False}),
  ('partial repair probe: salary cap boundary',
   [{'CPT': 'b', 'FLEX': ['g', 'e', 'f', 'c', 'a']},
    {'a': 1333, 'b': -50, 'c': 225, 'd': 1333, 'e': 1333, 'f': 225, 'g': 1795, 'h': 1795},
    {'a': 10500, 'b': 5500, 'c': 5300, 'd': 8700, 'e': 8700, 'f': 10500, 'g': 7100, 'h': 3300},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 4836, 'reason': 'cap', 'salary': 50400, 'valid': False}),
  ('second regression',
   [{'CPT': 'c', 'FLEX': ['h', 'f', 'd', 'g', 'a']},
    {'a': -45, 'b': -45, 'c': 1333, 'd': 2001, 'e': 0, 'f': 225, 'g': -45, 'h': 2001},
    {'a': 10500, 'b': 7100, 'c': 5500, 'd': 5500, 'e': 7100, 'f': 7100, 'g': 7100, 'h': 5300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 43700],
   {'points': 6137, 'reason': 'cap', 'salary': 43800, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'g', 'FLEX': ['b', 'a', 'g', 'e', 'd']},
    {'a': 1333, 'b': -50, 'c': 0, 'd': 1551, 'e': 2001, 'f': 2001, 'g': -50, 'h': 1030},
    {'a': 10500, 'b': 9900, 'c': 5300, 'd': 5300, 'e': 8700, 'f': 5500, 'g': 10500, 'h': 5300},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 60600],
   {'points': 4710, 'reason': 'roster', 'salary': 60700, 'valid': False}),
  ('normal control 2',
   [{'CPT': 'f', 'FLEX': ['h', 'f', 'e', 'a', 'c']},
    {'a': 169, 'b': 2001, 'c': 0, 'd': 1333, 'e': -45, 'f': 2001, 'g': 2001, 'h': -45},
    {'a': 5500, 'b': 5300, 'c': 7100, 'd': 8700, 'e': 8700, 'f': 3300, 'g': 8700, 'h': 5300},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 50000],
   {'points': 5082, 'reason': 'roster', 'salary': 34900, 'valid': False}),
  ('normal control 3',
   [{'CPT': 'e', 'FLEX': ['d', 'g', 'a', 'h']},
    {'a': 0, 'b': 1020, 'c': 2001, 'd': 0, 'e': 2001, 'f': -45, 'g': -50, 'h': 225},
    {'a': 7100, 'b': 9900, 'c': 5500, 'd': 8700, 'e': 5500, 'f': 7100, 'g': 5300, 'h': 8700},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 50000],
   {'points': 3177, 'reason': 'roster', 'salary': 38100, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'd', 'FLEX': ['h', 'a', 'c', 'g', 'b']},
    {'a': 225, 'b': 2001, 'c': 1333, 'd': 0, 'e': -45, 'f': 2498, 'g': 1795, 'h': 225},
    {'a': 7100, 'b': 8700, 'c': 3300, 'd': 10500, 'e': 5300, 'f': 10500, 'g': 5300, 'h': 7100},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 47400],
   {'points': 5579, 'reason': None, 'salary': 47300, 'valid': True})],
 [('regression: salary cap boundary',
   [{'CPT': 'a', 'FLEX': ['g', 'e', 'd', 'c', 'h']},
    {'a': 0, 'b': -50, 'c': 1108, 'd': 225, 'e': 2524, 'f': 1333, 'g': 1795, 'h': -45},
    {'a': 10500, 'b': 5300, 'c': 5300, 'd': 10500, 'e': 5500, 'f': 7100, 'g': 3300, 'h': 5300},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'A'}, 45700],
   {'points': 5607, 'reason': None, 'salary': 45700, 'valid': True}),
  ('partial repair probe: salary cap boundary',
   [{'CPT': 'a', 'FLEX': ['h', 'g', 'b', 'e', 'd']},
    {'a': 2105, 'b': 1333, 'c': 1333, 'd': 1333, 'e': -45, 'f': -40, 'g': 1795, 'h': 2051},
    {'a': 5300, 'b': 7100, 'c': 7100, 'd': 8700, 'e': 7100, 'f': 7100, 'g': 10500, 'h': 5500},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 46800],
   {'points': 9625, 'reason': 'cap', 'salary': 46900, 'valid': False}),
  ('second regression',
   [{'CPT': 'b', 'FLEX': ['g', 'f', 'c', 'h', 'd']},
    {'a': -45, 'b': -45, 'c': -45, 'd': 225, 'e': 1333, 'f': 0, 'g': 1333, 'h': 376},
    {'a': 5500, 'b': 7100, 'c': 9900, 'd': 10500, 'e': 7100, 'f': 9900, 'g': 9900, 'h': 3300},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 54200],
   {'points': 1821, 'reason': None, 'salary': 54200, 'valid': True}),
  ('normal control 1',
   [{'CPT': 'c', 'FLEX': ['f', 'h', 'b', 'c', 'e']},
    {'a': 1795, 'b': 225, 'c': -45, 'd': 0, 'e': 2001, 'f': 225, 'g': 225, 'h': 1745},
    {'a': 8700, 'b': 3300, 'c': 5300, 'd': 3300, 'e': 3300, 'f': 5500, 'g': 3300, 'h': 7100},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 32600],
   {'points': 4083, 'reason': 'roster', 'salary': 32500, 'valid': False}),
  ('normal control 2',
   [{'CPT': 'c', 'FLEX': ['h', 'b', 'a', 'd', 'c']},
    {'a': 0, 'b': 0, 'c': -45, 'd': 225, 'e': -50, 'f': 2001, 'g': 1795, 'h': 225},
    {'a': 3300, 'b': 3300, 'c': 7100, 'd': 3300, 'e': 9900, 'f': 3300, 'g': 7100, 'h': 7100},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 34900],
   {'points': 337, 'reason': 'roster', 'salary': 34800, 'valid': False}),
  ('normal control 3',
   [{'CPT': 'h', 'FLEX': ['e', 'b', 'f', 'h']},
    {'a': 225, 'b': 940, 'c': 769, 'd': 0, 'e': -50, 'f': 1795, 'g': -45, 'h': 1333},
    {'a': 5500, 'b': 8700, 'c': 10500, 'd': 5500, 'e': 10500, 'f': 10500, 'g': 3300, 'h': 3300},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 38000],
   {'points': 6018, 'reason': 'roster', 'salary': 38000, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'f', 'FLEX': ['c', 'h', 'd', 'e', 'f']},
    {'a': 0, 'b': 1681, 'c': -45, 'd': 0, 'e': 1333, 'f': 2001, 'g': -50, 'h': 0},
    {'a': 3300, 'b': 3300, 'c': 9900, 'd': 9900, 'e': 5300, 'f': 9900, 'g': 3300, 'h': 7100},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 50000],
   {'points': 6291, 'reason': 'roster', 'salary': 57000, 'valid': False})]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A lineup using every dollar of the cap is refused as over budget.

A single-game lineup has one captain and five flex players. The captain costs 1.5x salary rounded up to the next 100 and scores 1.5x points (hundredths, rounded half away from zero). Validation order: exactly five flex players and six distinct names (roster), salary total at most the cap (cap), players from at least two teams (teams). Return validity, first failing reason, salary and points.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(lineup, points, salaries, teams, cap):
    cpt, flex = lineup['CPT'], lineup['FLEX']
    names = [cpt] + flex
    cpt_salary = -(-salaries[cpt] * 3 // 200) * 100
    salary = cpt_salary + sum(salaries[p] for p in flex)
    c = points[cpt] * 3
    cpt_pts = (abs(c) + 1) // 2 * (1 if c >= 0 else -1)
    total = cpt_pts + sum(points[p] for p in flex)
    if len(flex) != 5 or len(set(flex)) != 5:
        return {'valid': False, 'reason': 'roster', 'salary': salary, 'points': total}
    if salary > cap:
        return {'valid': False, 'reason': 'cap', 'salary': salary, 'points': total}
    if len({teams[p] for p in names}) < 2:
        return {'valid': False, 'reason': 'teams', 'salary': salary, 'points': total}
    return {'valid': True, 'reason': None, 'salary': salary, 'points': total}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: captain duplicated in flex',
   [{'CPT': 'b', 'FLEX': ['h', 'f', 'a', 'b', 'e']},
    {'a': 666, 'b': 0, 'c': 1333, 'd': 2001, 'e': 225, 'f': 1333, 'g': 0, 'h': -45},
    {'a': 3300, 'b': 3300, 'c': 8700, 'd': 5300, 'e': 5500, 'f': 7100, 'g': 5500, 'h': 5300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 2179, 'reason': 'roster', 'salary': 29500, 'valid': False}),
  ('partial repair probe: captain duplicated in flex',
   [{'CPT': 'g', 'FLEX': ['b', 'a', 'f', 'g', 'c']},
    {'a': 2001, 'b': 1333, 'c': 225, 'd': 2001, 'e': 2001, 'f': 1795, 'g': -45, 'h': 2001},
    {'a': 5500, 'b': 10500, 'c': 8700, 'd': 9900, 'e': 3300, 'f': 3300, 'g': 8700, 'h': 5300},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 49700],
   {'points': 5241, 'reason': 'roster', 'salary': 49800, 'valid': False}),
  ('second regression',
   [{'CPT': 'e', 'FLEX': ['d', 'h', 'a', 'c', 'e']},
    {'a': 2001, 'b': 1795, 'c': -50, 'd': -50, 'e': 1795, 'f': -45, 'g': -45, 'h': -45},
    {'a': 10500, 'b': 10500, 'c': 5500, 'd': 3300, 'e': 9900, 'f': 5300, 'g': 9900, 'h': 8700},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 52800],
   {'points': 6344, 'reason': 'roster', 'salary': 52800, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'g', 'FLEX': ['d', 'h', 'b', 'a', 'f']},
    {'a': 2869, 'b': 2001, 'c': 1795, 'd': 2001, 'e': 0, 'f': 225, 'g': -45, 'h': -50},
    {'a': 5300, 'b': 7100, 'c': 5500, 'd': 10500, 'e': 10500, 'f': 8700, 'g': 3300, 'h': 5500},
    {'a': 'A', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'A', 'g': 'A', 'h': 'A'}, 50000],
   {'points': 6978, 'reason': None, 'salary': 42100, 'valid': True}),
  ('normal control 2',
   [{'CPT': 'c', 'FLEX': ['a', 'f', 'e', 'b', 'g']},
    {'a': -50, 'b': 225, 'c': 2001, 'd': 1333, 'e': 0, 'f': 2001, 'g': 1333, 'h': 225},
    {'a': 5500, 'b': 3300, 'c': 3300, 'd': 5500, 'e': 8700, 'f': 3300, 'g': 9900, 'h': 5300},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 6511, 'reason': None, 'salary': 35700, 'valid': True}),
  ('normal control 3',
   [{'CPT': 'e', 'FLEX': ['h', 'e', 'b', 'a', 'e']},
    {'a': 225, 'b': 225, 'c': 2001, 'd': 1795, 'e': 225, 'f': -50, 'g': -50, 'h': 225},
    {'a': 7100, 'b': 3300, 'c': 3300, 'd': 7100, 'e': 3300, 'f': 5300, 'g': 9900, 'h': 10500},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'A'}, 32600],
   {'points': 1463, 'reason': 'roster', 'salary': 32500, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'h', 'FLEX': ['a', 'd', 'f', 'b', 'c']},
    {'a': 1333, 'b': 2746, 'c': 1795, 'd': 225, 'e': 0, 'f': 2571, 'g': 0, 'h': 0},
    {'a': 5500, 'b': 10500, 'c': 5500, 'd': 5500, 'e': 5500, 'f': 5500, 'g': 8700, 'h': 5300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 40600],
   {'points': 8670, 'reason': None, 'salary': 40500, 'valid': True})],
 [('regression: captain duplicated in flex',
   [{'CPT': 'a', 'FLEX': ['g', 'e', 'c', 'd', 'a']},
    {'a': 225, 'b': -50, 'c': 0, 'd': 1681, 'e': -45, 'f': -50, 'g': 0, 'h': -45},
    {'a': 3300, 'b': 9900, 'c': 7100, 'd': 9900, 'e': 5300, 'f': 3300, 'g': 5300, 'h': 3300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'H'}, 36000],
   {'points': 2199, 'reason': 'roster', 'salary': 35900, 'valid': False}),
  ('partial repair probe: captain duplicated in flex',
   [{'CPT': 'f', 'FLEX': ['d', 'e', 'b', 'g', 'f']},
    {'a': 1795, 'b': 0, 'c': -45, 'd': 1333, 'e': 865, 'f': -50, 'g': 225, 'h': 2001},
    {'a': 5300, 'b': 10500, 'c': 8700, 'd': 9900, 'e': 7100, 'f': 5500, 'g': 9900, 'h': 9900},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 2298, 'reason': 'roster', 'salary': 51200, 'valid': False}),
  ('second regression',
   [{'CPT': 'h', 'FLEX': ['e', 'c', 'b', 'h', 'a']},
    {'a': 2714, 'b': 2001, 'c': -45, 'd': 2001, 'e': 2001, 'f': -50, 'g': 2001, 'h': 1333},
    {'a': 9900, 'b': 5500, 'c': 5500, 'd': 10500, 'e': 5300, 'f': 5300, 'g': 3300, 'h': 9900},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 51000],
   {'points': 10004, 'reason': 'roster', 'salary': 51000, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'd', 'FLEX': ['a', 'e', 'h', 'c', 'g']},
    {'a': 225, 'b': 225, 'c': 225, 'd': 218, 'e': -50, 'f': 1795, 'g': 1795, 'h': 1740},
    {'a': 5300, 'b': 5300, 'c': 5500, 'd': 7100, 'e': 9900, 'f': 8700, 'g': 5500, 'h': 5300},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 42300],
   {'points': 4262, 'reason': None, 'salary': 42200, 'valid': True}),
  ('normal control 2',
   [{'CPT': 'h', 'FLEX': ['f', 'g', 'c', 'b']},
    {'a': 1795, 'b': 225, 'c': 2001, 'd': -45, 'e': 180, 'f': -45, 'g': 0, 'h': 0},
    {'a': 7100, 'b': 5500, 'c': 5500, 'd': 9900, 'e': 7100, 'f': 10500, 'g': 8700, 'h': 3300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'A', 'h': 'H'}, 35300],
   {'points': 2181, 'reason': 'roster', 'salary': 35200, 'valid': False}),
  ('normal control 3',
   [{'CPT': 'a', 'FLEX': ['h', 'c', 'e', 'g', 'd']},
    {'a': -45, 'b': 2001, 'c': 0, 'd': 16, 'e': 225, 'f': 2001, 'g': 0, 'h': -45},
    {'a': 7100, 'b': 7100, 'c': 5500, 'd': 8700, 'e': 3300, 'f': 5500, 'g': 10500, 'h': 10500},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 49100],
   {'points': 128, 'reason': 'cap', 'salary': 49200, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'g', 'FLEX': ['h', 'c', 'd', 'a', 'e']},
    {'a': 0, 'b': -50, 'c': 225, 'd': 2001, 'e': -50, 'f': 1795, 'g': 1795, 'h': -50},
    {'a': 5500, 'b': 7100, 'c': 5500, 'd': 8700, 'e': 5500, 'f': 10500, 'g': 8700, 'h': 5300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 43500],
   {'points': 4819, 'reason': 'cap', 'salary': 43600, 'valid': False})],
 [('regression: captain duplicated in flex',
   [{'CPT': 'f', 'FLEX': ['h', 'f', 'b', 'c', 'a']},
    {'a': 1333, 'b': -50, 'c': 0, 'd': -50, 'e': 225, 'f': 915, 'g': 2001, 'h': -50},
    {'a': 9900, 'b': 9900, 'c': 3300, 'd': 8700, 'e': 8700, 'f': 8700, 'g': 8700, 'h': 7100},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'A', 'h': 'A'}, 51900],
   {'points': 3521, 'reason': 'roster', 'salary': 52000, 'valid': False}),
  ('partial repair probe: captain duplicated in flex',
   [{'CPT': 'c', 'FLEX': ['h', 'g', 'f', 'c', 'd']},
    {'a': 2001, 'b': 2001, 'c': 225, 'd': 225, 'e': -45, 'f': 225, 'g': 1795, 'h': -45},
    {'a': 5500, 'b': 10500, 'c': 5500, 'd': 8700, 'e': 5500, 'f': 9900, 'g': 5500, 'h': 9900},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 47800],
   {'points': 2763, 'reason': 'roster', 'salary': 47800, 'valid': False}),
  ('second regression',
   [{'CPT': 'c', 'FLEX': ['c', 'a', 'g', 'b', 'e']},
    {'a': -50, 'b': 1795, 'c': 0, 'd': 225, 'e': -50, 'f': 1795, 'g': -50, 'h': 1795},
    {'a': 7100, 'b': 3300, 'c': 10500, 'd': 10500, 'e': 7100, 'f': 5500, 'g': 9900, 'h': 7100},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 53800],
   {'points': 1645, 'reason': 'roster', 'salary': 53700, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'd', 'FLEX': ['c', 'e', 'f', 'a', 'h']},
    {'a': 2001, 'b': 1524, 'c': -60, 'd': -50, 'e': -50, 'f': 2001, 'g': 1795, 'h': -50},
    {'a': 7100, 'b': 9900, 'c': 5500, 'd': 7100, 'e': 5300, 'f': 5300, 'g': 3300, 'h': 9900},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'H'}, 43800],
   {'points': 3767, 'reason': None, 'salary': 43800, 'valid': True}),
  ('normal control 2',
   [{'CPT': 'b', 'FLEX': ['h', 'c', 'e', 'd', 'a']},
    {'a': 2001, 'b': -45, 'c': 1333, 'd': -54, 'e': 1264, 'f': 225, 'g': 1333, 'h': 1795},
    {'a': 7100, 'b': 3300, 'c': 9900, 'd': 7100, 'e': 8700, 'f': 5500, 'g': 9900, 'h': 9900},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 47600],
   {'points': 6271, 'reason': 'cap', 'salary': 47700, 'valid': False}),
  ('normal control 3',
   [{'CPT': 'b', 'FLEX': ['c', 'a', 'e', 'h', 'f']},
    {'a': 2001, 'b': -45, 'c': 1795, 'd': 652, 'e': 225, 'f': -50, 'g': 843, 'h': 1795},
    {'a': 9900, 'b': 9900, 'c': 10500, 'd': 10500, 'e': 10500, 'f': 9900, 'g': 5300, 'h': 9900},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 5698, 'reason': 'cap', 'salary': 65600, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'a', 'FLEX': ['f', 'd', 'g', 'h', 'e']},
    {'a': -50, 'b': -50, 'c': 225, 'd': 1333, 'e': 2448, 'f': 0, 'g': 1795, 'h': 1769},
    {'a': 5300, 'b': 5300, 'c': 5500, 'd': 5300, 'e': 8700, 'f': 5300, 'g': 3300, 'h': 10500},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 41000],
   {'points': 7270, 'reason': 'cap', 'salary': 41100, 'valid': False})],
 [('regression: captain duplicated in flex',
   [{'CPT': 'c', 'FLEX': ['e', 'c', 'a', 'd', 'g']},
    {'a': 2001, 'b': -45, 'c': -86, 'd': 0, 'e': 1837, 'f': 1795, 'g': -45, 'h': 1795},
    {'a': 8700, 'b': 9900, 'c': 8700, 'd': 10500, 'e': 10500, 'f': 5300, 'g': 7100, 'h': 5500},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 58700],
   {'points': 3578, 'reason': 'roster', 'salary': 58600, 'valid': False}),
  ('partial repair probe: captain duplicated in flex',
   [{'CPT': 'b', 'FLEX': ['e', 'b', 'h', 'g', 'c']},
    {'a': 1333, 'b': 2001, 'c': 2001, 'd': 1795, 'e': 2001, 'f': 1795, 'g': 225, 'h': 2001},
    {'a': 10500, 'b': 9900, 'c': 3300, 'd': 8700, 'e': 7100, 'f': 3300, 'g': 7100, 'h': 5300},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'H'}, 47600],
   {'points': 11231, 'reason': 'roster', 'salary': 47600, 'valid': False}),
  ('second regression',
   [{'CPT': 'g', 'FLEX': ['f', 'd', 'g', 'e', 'c']},
    {'a': 1795, 'b': -50, 'c': 1795, 'd': 1795, 'e': -45, 'f': -45, 'g': 1795, 'h': 1333},
    {'a': 9900, 'b': 7100, 'c': 5500, 'd': 5500, 'e': 7100, 'f': 5300, 'g': 9900, 'h': 8700},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 50000],
   {'points': 7988, 'reason': 'roster', 'salary': 48200, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'e', 'FLEX': ['b', 'd', 'h', 'a', 'g']},
    {'a': 0, 'b': 1333, 'c': -50, 'd': 1795, 'e': -50, 'f': 0, 'g': -50, 'h': 0},
    {'a': 7100, 'b': 8700, 'c': 9900, 'd': 7100, 'e': 5300, 'f': 8700, 'g': 5300, 'h': 3300},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'A', 'h': 'H'}, 39400],
   {'points': 3003, 'reason': 'cap', 'salary': 39500, 'valid': False}),
  ('normal control 2',
   [{'CPT': 'g', 'FLEX': ['c', 'a', 'd', 'h']},
    {'a': 1795, 'b': 1795, 'c': 1333, 'd': 1333, 'e': -50, 'f': -45, 'g': 1333, 'h': 2001},
    {'a': 3300, 'b': 7100, 'c': 9900, 'd': 10500, 'e': 9900, 'f': 5300, 'g': 7100, 'h': 9900},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'A', 'h': 'H'}, 50000],
   {'points': 8462, 'reason': 'roster', 'salary': 44300, 'valid': False}),
  ('normal control 3',
   [{'CPT': 'h', 'FLEX': ['f', 'd', 'e', 'b', 'g']},
    {'a': -45, 'b': 225, 'c': 1795, 'd': 1333, 'e': -50, 'f': -45, 'g': 0, 'h': 0},
    {'a': 8700, 'b': 8700, 'c': 5500, 'd': 5300, 'e': 5300, 'f': 5500, 'g': 7100, 'h': 5500},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'A'}, 40200],
   {'points': 1463, 'reason': None, 'salary': 40200, 'valid': True}),
  ('normal control 4',
   [{'CPT': 'd', 'FLEX': ['c', 'a', 'h', 'b', 'e']},
    {'a': -50, 'b': 2001, 'c': 1333, 'd': 1333, 'e': 1333, 'f': 0, 'g': 1333, 'h': 2001},
    {'a': 5500, 'b': 5300, 'c': 8700, 'd': 10500, 'e': 3300, 'f': 10500, 'g': 8700, 'h': 3300},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 42000],
   {'points': 8618, 'reason': None, 'salary': 41900, 'valid': True})],
 [('regression: captain duplicated in flex',
   [{'CPT': 'c', 'FLEX': ['a', 'h', 'b', 'f', 'c']},
    {'a': 1333, 'b': -50, 'c': 0, 'd': 225, 'e': -50, 'f': 2001, 'g': 2001, 'h': 1333},
    {'a': 3300, 'b': 3300, 'c': 9900, 'd': 8700, 'e': 5300, 'f': 7100, 'g': 9900, 'h': 3300},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 41900],
   {'points': 4617, 'reason': 'roster', 'salary': 41800, 'valid': False}),
  ('partial repair probe: captain duplicated in flex',
   [{'CPT': 'g', 'FLEX': ['c', 'e', 'b', 'g', 'a']},
    {'a': 1795, 'b': 1795, 'c': -45, 'd': 2001, 'e': -45, 'f': 2001, 'g': 225, 'h': 225},
    {'a': 7100, 'b': 9900, 'c': 3300, 'd': 3300, 'e': 9900, 'f': 5500, 'g': 5500, 'h': 10500},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 44000],
   {'points': 4063, 'reason': 'roster', 'salary': 44000, 'valid': False}),
  ('second regression',
   [{'CPT': 'd', 'FLEX': ['d', 'h', 'e', 'b', 'a']},
    {'a': 225, 'b': 2001, 'c': 1921, 'd': 1795, 'e': 225, 'f': -50, 'g': 1795, 'h': 1795},
    {'a': 3300, 'b': 5500, 'c': 5300, 'd': 10500, 'e': 9900, 'f': 5300, 'g': 10500, 'h': 5300},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'A', 'h': 'H'}, 50300],
   {'points': 8734, 'reason': 'roster', 'salary': 50300, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'g', 'FLEX': ['g', 'e', 'd', 'b']},
    {'a': 2861, 'b': -45, 'c': 0, 'd': 2001, 'e': 0, 'f': -50, 'g': 1333, 'h': 1156},
    {'a': 3300, 'b': 3300, 'c': 9900, 'd': 8700, 'e': 9900, 'f': 7100, 'g': 7100, 'h': 9900},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 39700],
   {'points': 5289, 'reason': 'roster', 'salary': 39700, 'valid': False}),
  ('normal control 2',
   [{'CPT': 'd', 'FLEX': ['b', 'c', 'a', 'f', 'g']},
    {'a': 0, 'b': -45, 'c': 1333, 'd': 1333, 'e': -50, 'f': -45, 'g': -50, 'h': 1795},
    {'a': 7100, 'b': 7100, 'c': 5500, 'd': 5300, 'e': 5500, 'f': 9900, 'g': 5300, 'h': 5500},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 3193, 'reason': None, 'salary': 42900, 'valid': True}),
  ('normal control 3',
   [{'CPT': 'g', 'FLEX': ['c', 'h', 'b', 'e', 'a']},
    {'a': 1795, 'b': 0, 'c': 1333, 'd': 225, 'e': 2001, 'f': 1333, 'g': 1795, 'h': 1333},
    {'a': 8700, 'b': 5500, 'c': 3300, 'd': 5500, 'e': 10500, 'f': 5300, 'g': 9900, 'h': 9900},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 52900],
   {'points': 9155, 'reason': None, 'salary': 52800, 'valid': True}),
  ('normal control 4',
   [{'CPT': 'a', 'FLEX': ['c', 'd', 'b', 'e', 'h']},
    {'a': 1333, 'b': -50, 'c': 1333, 'd': 2001, 'e': 1795, 'f': 2001, 'g': 2001, 'h': 225},
    {'a': 5500, 'b': 8700, 'c': 3300, 'd': 5500, 'e': 10500, 'f': 5500, 'g': 8700, 'h': 8700},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 44900],
   {'points': 7304, 'reason': 'cap', 'salary': 45000, 'valid': False})]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(lineup, points, salaries, teams, cap):
    cpt, flex = lineup['CPT'], lineup['FLEX']
    names = [cpt] + flex
    cpt_salary = -(-salaries[cpt] * 3 // 200) * 100
    salary = cpt_salary + sum(salaries[p] for p in flex)
    c = points[cpt] * 3
    cpt_pts = (abs(c) + 1) // 2 * (1 if c >= 0 else -1)
    total = cpt_pts + sum(points[p] for p in flex)
    if len(flex) != 5 or len(set(flex)) != 5 or cpt == flex[0]:
        return {'valid': False, 'reason': 'roster', 'salary': salary, 'points': total}
    if salary > cap:
        return {'valid': False, 'reason': 'cap', 'salary': salary, 'points': total}
    if len({teams[p] for p in names}) < 2:
        return {'valid': False, 'reason': 'teams', 'salary': salary, 'points': total}
    return {'valid': True, 'reason': None, 'salary': salary, 'points': total}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: captain duplicated in flex',
   [{'CPT': 'b', 'FLEX': ['h', 'f', 'a', 'b', 'e']},
    {'a': 666, 'b': 0, 'c': 1333, 'd': 2001, 'e': 225, 'f': 1333, 'g': 0, 'h': -45},
    {'a': 3300, 'b': 3300, 'c': 8700, 'd': 5300, 'e': 5500, 'f': 7100, 'g': 5500, 'h': 5300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 2179, 'reason': 'roster', 'salary': 29500, 'valid': False}),
  ('partial repair probe: captain duplicated in flex',
   [{'CPT': 'g', 'FLEX': ['b', 'a', 'f', 'g', 'c']},
    {'a': 2001, 'b': 1333, 'c': 225, 'd': 2001, 'e': 2001, 'f': 1795, 'g': -45, 'h': 2001},
    {'a': 5500, 'b': 10500, 'c': 8700, 'd': 9900, 'e': 3300, 'f': 3300, 'g': 8700, 'h': 5300},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 49700],
   {'points': 5241, 'reason': 'roster', 'salary': 49800, 'valid': False}),
  ('second regression',
   [{'CPT': 'e', 'FLEX': ['d', 'h', 'a', 'c', 'e']},
    {'a': 2001, 'b': 1795, 'c': -50, 'd': -50, 'e': 1795, 'f': -45, 'g': -45, 'h': -45},
    {'a': 10500, 'b': 10500, 'c': 5500, 'd': 3300, 'e': 9900, 'f': 5300, 'g': 9900, 'h': 8700},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 52800],
   {'points': 6344, 'reason': 'roster', 'salary': 52800, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'g', 'FLEX': ['d', 'h', 'b', 'a', 'f']},
    {'a': 2869, 'b': 2001, 'c': 1795, 'd': 2001, 'e': 0, 'f': 225, 'g': -45, 'h': -50},
    {'a': 5300, 'b': 7100, 'c': 5500, 'd': 10500, 'e': 10500, 'f': 8700, 'g': 3300, 'h': 5500},
    {'a': 'A', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'A', 'g': 'A', 'h': 'A'}, 50000],
   {'points': 6978, 'reason': None, 'salary': 42100, 'valid': True}),
  ('normal control 2',
   [{'CPT': 'c', 'FLEX': ['a', 'f', 'e', 'b', 'g']},
    {'a': -50, 'b': 225, 'c': 2001, 'd': 1333, 'e': 0, 'f': 2001, 'g': 1333, 'h': 225},
    {'a': 5500, 'b': 3300, 'c': 3300, 'd': 5500, 'e': 8700, 'f': 3300, 'g': 9900, 'h': 5300},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 6511, 'reason': None, 'salary': 35700, 'valid': True}),
  ('normal control 3',
   [{'CPT': 'e', 'FLEX': ['h', 'e', 'b', 'a', 'e']},
    {'a': 225, 'b': 225, 'c': 2001, 'd': 1795, 'e': 225, 'f': -50, 'g': -50, 'h': 225},
    {'a': 7100, 'b': 3300, 'c': 3300, 'd': 7100, 'e': 3300, 'f': 5300, 'g': 9900, 'h': 10500},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'A'}, 32600],
   {'points': 1463, 'reason': 'roster', 'salary': 32500, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'h', 'FLEX': ['a', 'd', 'f', 'b', 'c']},
    {'a': 1333, 'b': 2746, 'c': 1795, 'd': 225, 'e': 0, 'f': 2571, 'g': 0, 'h': 0},
    {'a': 5500, 'b': 10500, 'c': 5500, 'd': 5500, 'e': 5500, 'f': 5500, 'g': 8700, 'h': 5300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 40600],
   {'points': 8670, 'reason': None, 'salary': 40500, 'valid': True})],
 [('regression: captain duplicated in flex',
   [{'CPT': 'a', 'FLEX': ['g', 'e', 'c', 'd', 'a']},
    {'a': 225, 'b': -50, 'c': 0, 'd': 1681, 'e': -45, 'f': -50, 'g': 0, 'h': -45},
    {'a': 3300, 'b': 9900, 'c': 7100, 'd': 9900, 'e': 5300, 'f': 3300, 'g': 5300, 'h': 3300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'H'}, 36000],
   {'points': 2199, 'reason': 'roster', 'salary': 35900, 'valid': False}),
  ('partial repair probe: captain duplicated in flex',
   [{'CPT': 'f', 'FLEX': ['d', 'e', 'b', 'g', 'f']},
    {'a': 1795, 'b': 0, 'c': -45, 'd': 1333, 'e': 865, 'f': -50, 'g': 225, 'h': 2001},
    {'a': 5300, 'b': 10500, 'c': 8700, 'd': 9900, 'e': 7100, 'f': 5500, 'g': 9900, 'h': 9900},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 2298, 'reason': 'roster', 'salary': 51200, 'valid': False}),
  ('second regression',
   [{'CPT': 'h', 'FLEX': ['e', 'c', 'b', 'h', 'a']},
    {'a': 2714, 'b': 2001, 'c': -45, 'd': 2001, 'e': 2001, 'f': -50, 'g': 2001, 'h': 1333},
    {'a': 9900, 'b': 5500, 'c': 5500, 'd': 10500, 'e': 5300, 'f': 5300, 'g': 3300, 'h': 9900},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 51000],
   {'points': 10004, 'reason': 'roster', 'salary': 51000, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'd', 'FLEX': ['a', 'e', 'h', 'c', 'g']},
    {'a': 225, 'b': 225, 'c': 225, 'd': 218, 'e': -50, 'f': 1795, 'g': 1795, 'h': 1740},
    {'a': 5300, 'b': 5300, 'c': 5500, 'd': 7100, 'e': 9900, 'f': 8700, 'g': 5500, 'h': 5300},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 42300],
   {'points': 4262, 'reason': None, 'salary': 42200, 'valid': True}),
  ('normal control 2',
   [{'CPT': 'h', 'FLEX': ['f', 'g', 'c', 'b']},
    {'a': 1795, 'b': 225, 'c': 2001, 'd': -45, 'e': 180, 'f': -45, 'g': 0, 'h': 0},
    {'a': 7100, 'b': 5500, 'c': 5500, 'd': 9900, 'e': 7100, 'f': 10500, 'g': 8700, 'h': 3300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'A', 'h': 'H'}, 35300],
   {'points': 2181, 'reason': 'roster', 'salary': 35200, 'valid': False}),
  ('normal control 3',
   [{'CPT': 'a', 'FLEX': ['h', 'c', 'e', 'g', 'd']},
    {'a': -45, 'b': 2001, 'c': 0, 'd': 16, 'e': 225, 'f': 2001, 'g': 0, 'h': -45},
    {'a': 7100, 'b': 7100, 'c': 5500, 'd': 8700, 'e': 3300, 'f': 5500, 'g': 10500, 'h': 10500},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 49100],
   {'points': 128, 'reason': 'cap', 'salary': 49200, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'g', 'FLEX': ['h', 'c', 'd', 'a', 'e']},
    {'a': 0, 'b': -50, 'c': 225, 'd': 2001, 'e': -50, 'f': 1795, 'g': 1795, 'h': -50},
    {'a': 5500, 'b': 7100, 'c': 5500, 'd': 8700, 'e': 5500, 'f': 10500, 'g': 8700, 'h': 5300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 43500],
   {'points': 4819, 'reason': 'cap', 'salary': 43600, 'valid': False})],
 [('regression: captain duplicated in flex',
   [{'CPT': 'f', 'FLEX': ['h', 'f', 'b', 'c', 'a']},
    {'a': 1333, 'b': -50, 'c': 0, 'd': -50, 'e': 225, 'f': 915, 'g': 2001, 'h': -50},
    {'a': 9900, 'b': 9900, 'c': 3300, 'd': 8700, 'e': 8700, 'f': 8700, 'g': 8700, 'h': 7100},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'A', 'h': 'A'}, 51900],
   {'points': 3521, 'reason': 'roster', 'salary': 52000, 'valid': False}),
  ('partial repair probe: captain duplicated in flex',
   [{'CPT': 'c', 'FLEX': ['h', 'g', 'f', 'c', 'd']},
    {'a': 2001, 'b': 2001, 'c': 225, 'd': 225, 'e': -45, 'f': 225, 'g': 1795, 'h': -45},
    {'a': 5500, 'b': 10500, 'c': 5500, 'd': 8700, 'e': 5500, 'f': 9900, 'g': 5500, 'h': 9900},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 47800],
   {'points': 2763, 'reason': 'roster', 'salary': 47800, 'valid': False}),
  ('second regression',
   [{'CPT': 'c', 'FLEX': ['c', 'a', 'g', 'b', 'e']},
    {'a': -50, 'b': 1795, 'c': 0, 'd': 225, 'e': -50, 'f': 1795, 'g': -50, 'h': 1795},
    {'a': 7100, 'b': 3300, 'c': 10500, 'd': 10500, 'e': 7100, 'f': 5500, 'g': 9900, 'h': 7100},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 53800],
   {'points': 1645, 'reason': 'roster', 'salary': 53700, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'd', 'FLEX': ['c', 'e', 'f', 'a', 'h']},
    {'a': 2001, 'b': 1524, 'c': -60, 'd': -50, 'e': -50, 'f': 2001, 'g': 1795, 'h': -50},
    {'a': 7100, 'b': 9900, 'c': 5500, 'd': 7100, 'e': 5300, 'f': 5300, 'g': 3300, 'h': 9900},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'H'}, 43800],
   {'points': 3767, 'reason': None, 'salary': 43800, 'valid': True}),
  ('normal control 2',
   [{'CPT': 'b', 'FLEX': ['h', 'c', 'e', 'd', 'a']},
    {'a': 2001, 'b': -45, 'c': 1333, 'd': -54, 'e': 1264, 'f': 225, 'g': 1333, 'h': 1795},
    {'a': 7100, 'b': 3300, 'c': 9900, 'd': 7100, 'e': 8700, 'f': 5500, 'g': 9900, 'h': 9900},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 47600],
   {'points': 6271, 'reason': 'cap', 'salary': 47700, 'valid': False}),
  ('normal control 3',
   [{'CPT': 'b', 'FLEX': ['c', 'a', 'e', 'h', 'f']},
    {'a': 2001, 'b': -45, 'c': 1795, 'd': 652, 'e': 225, 'f': -50, 'g': 843, 'h': 1795},
    {'a': 9900, 'b': 9900, 'c': 10500, 'd': 10500, 'e': 10500, 'f': 9900, 'g': 5300, 'h': 9900},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 5698, 'reason': 'cap', 'salary': 65600, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'a', 'FLEX': ['f', 'd', 'g', 'h', 'e']},
    {'a': -50, 'b': -50, 'c': 225, 'd': 1333, 'e': 2448, 'f': 0, 'g': 1795, 'h': 1769},
    {'a': 5300, 'b': 5300, 'c': 5500, 'd': 5300, 'e': 8700, 'f': 5300, 'g': 3300, 'h': 10500},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 41000],
   {'points': 7270, 'reason': 'cap', 'salary': 41100, 'valid': False})],
 [('regression: captain duplicated in flex',
   [{'CPT': 'c', 'FLEX': ['e', 'c', 'a', 'd', 'g']},
    {'a': 2001, 'b': -45, 'c': -86, 'd': 0, 'e': 1837, 'f': 1795, 'g': -45, 'h': 1795},
    {'a': 8700, 'b': 9900, 'c': 8700, 'd': 10500, 'e': 10500, 'f': 5300, 'g': 7100, 'h': 5500},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 58700],
   {'points': 3578, 'reason': 'roster', 'salary': 58600, 'valid': False}),
  ('partial repair probe: captain duplicated in flex',
   [{'CPT': 'b', 'FLEX': ['e', 'b', 'h', 'g', 'c']},
    {'a': 1333, 'b': 2001, 'c': 2001, 'd': 1795, 'e': 2001, 'f': 1795, 'g': 225, 'h': 2001},
    {'a': 10500, 'b': 9900, 'c': 3300, 'd': 8700, 'e': 7100, 'f': 3300, 'g': 7100, 'h': 5300},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'H'}, 47600],
   {'points': 11231, 'reason': 'roster', 'salary': 47600, 'valid': False}),
  ('second regression',
   [{'CPT': 'g', 'FLEX': ['f', 'd', 'g', 'e', 'c']},
    {'a': 1795, 'b': -50, 'c': 1795, 'd': 1795, 'e': -45, 'f': -45, 'g': 1795, 'h': 1333},
    {'a': 9900, 'b': 7100, 'c': 5500, 'd': 5500, 'e': 7100, 'f': 5300, 'g': 9900, 'h': 8700},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 50000],
   {'points': 7988, 'reason': 'roster', 'salary': 48200, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'e', 'FLEX': ['b', 'd', 'h', 'a', 'g']},
    {'a': 0, 'b': 1333, 'c': -50, 'd': 1795, 'e': -50, 'f': 0, 'g': -50, 'h': 0},
    {'a': 7100, 'b': 8700, 'c': 9900, 'd': 7100, 'e': 5300, 'f': 8700, 'g': 5300, 'h': 3300},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'A', 'h': 'H'}, 39400],
   {'points': 3003, 'reason': 'cap', 'salary': 39500, 'valid': False}),
  ('normal control 2',
   [{'CPT': 'g', 'FLEX': ['c', 'a', 'd', 'h']},
    {'a': 1795, 'b': 1795, 'c': 1333, 'd': 1333, 'e': -50, 'f': -45, 'g': 1333, 'h': 2001},
    {'a': 3300, 'b': 7100, 'c': 9900, 'd': 10500, 'e': 9900, 'f': 5300, 'g': 7100, 'h': 9900},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'A', 'h': 'H'}, 50000],
   {'points': 8462, 'reason': 'roster', 'salary': 44300, 'valid': False}),
  ('normal control 3',
   [{'CPT': 'h', 'FLEX': ['f', 'd', 'e', 'b', 'g']},
    {'a': -45, 'b': 225, 'c': 1795, 'd': 1333, 'e': -50, 'f': -45, 'g': 0, 'h': 0},
    {'a': 8700, 'b': 8700, 'c': 5500, 'd': 5300, 'e': 5300, 'f': 5500, 'g': 7100, 'h': 5500},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'A'}, 40200],
   {'points': 1463, 'reason': None, 'salary': 40200, 'valid': True}),
  ('normal control 4',
   [{'CPT': 'd', 'FLEX': ['c', 'a', 'h', 'b', 'e']},
    {'a': -50, 'b': 2001, 'c': 1333, 'd': 1333, 'e': 1333, 'f': 0, 'g': 1333, 'h': 2001},
    {'a': 5500, 'b': 5300, 'c': 8700, 'd': 10500, 'e': 3300, 'f': 10500, 'g': 8700, 'h': 3300},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 42000],
   {'points': 8618, 'reason': None, 'salary': 41900, 'valid': True})],
 [('regression: captain duplicated in flex',
   [{'CPT': 'c', 'FLEX': ['a', 'h', 'b', 'f', 'c']},
    {'a': 1333, 'b': -50, 'c': 0, 'd': 225, 'e': -50, 'f': 2001, 'g': 2001, 'h': 1333},
    {'a': 3300, 'b': 3300, 'c': 9900, 'd': 8700, 'e': 5300, 'f': 7100, 'g': 9900, 'h': 3300},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 41900],
   {'points': 4617, 'reason': 'roster', 'salary': 41800, 'valid': False}),
  ('partial repair probe: captain duplicated in flex',
   [{'CPT': 'g', 'FLEX': ['c', 'e', 'b', 'g', 'a']},
    {'a': 1795, 'b': 1795, 'c': -45, 'd': 2001, 'e': -45, 'f': 2001, 'g': 225, 'h': 225},
    {'a': 7100, 'b': 9900, 'c': 3300, 'd': 3300, 'e': 9900, 'f': 5500, 'g': 5500, 'h': 10500},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 44000],
   {'points': 4063, 'reason': 'roster', 'salary': 44000, 'valid': False}),
  ('second regression',
   [{'CPT': 'd', 'FLEX': ['d', 'h', 'e', 'b', 'a']},
    {'a': 225, 'b': 2001, 'c': 1921, 'd': 1795, 'e': 225, 'f': -50, 'g': 1795, 'h': 1795},
    {'a': 3300, 'b': 5500, 'c': 5300, 'd': 10500, 'e': 9900, 'f': 5300, 'g': 10500, 'h': 5300},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'A', 'h': 'H'}, 50300],
   {'points': 8734, 'reason': 'roster', 'salary': 50300, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'g', 'FLEX': ['g', 'e', 'd', 'b']},
    {'a': 2861, 'b': -45, 'c': 0, 'd': 2001, 'e': 0, 'f': -50, 'g': 1333, 'h': 1156},
    {'a': 3300, 'b': 3300, 'c': 9900, 'd': 8700, 'e': 9900, 'f': 7100, 'g': 7100, 'h': 9900},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 39700],
   {'points': 5289, 'reason': 'roster', 'salary': 39700, 'valid': False}),
  ('normal control 2',
   [{'CPT': 'd', 'FLEX': ['b', 'c', 'a', 'f', 'g']},
    {'a': 0, 'b': -45, 'c': 1333, 'd': 1333, 'e': -50, 'f': -45, 'g': -50, 'h': 1795},
    {'a': 7100, 'b': 7100, 'c': 5500, 'd': 5300, 'e': 5500, 'f': 9900, 'g': 5300, 'h': 5500},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 3193, 'reason': None, 'salary': 42900, 'valid': True}),
  ('normal control 3',
   [{'CPT': 'g', 'FLEX': ['c', 'h', 'b', 'e', 'a']},
    {'a': 1795, 'b': 0, 'c': 1333, 'd': 225, 'e': 2001, 'f': 1333, 'g': 1795, 'h': 1333},
    {'a': 8700, 'b': 5500, 'c': 3300, 'd': 5500, 'e': 10500, 'f': 5300, 'g': 9900, 'h': 9900},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 52900],
   {'points': 9155, 'reason': None, 'salary': 52800, 'valid': True}),
  ('normal control 4',
   [{'CPT': 'a', 'FLEX': ['c', 'd', 'b', 'e', 'h']},
    {'a': 1333, 'b': -50, 'c': 1333, 'd': 2001, 'e': 1795, 'f': 2001, 'g': 2001, 'h': 225},
    {'a': 5500, 'b': 8700, 'c': 3300, 'd': 5500, 'e': 10500, 'f': 5500, 'g': 8700, 'h': 8700},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 44900],
   {'points': 7304, 'reason': 'cap', 'salary': 45000, 'valid': False})]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A lineup lists the same quarterback as captain and flex and earns 2.5x his points.

A single-game lineup has one captain and five flex players. The captain costs 1.5x salary rounded up to the next 100 and scores 1.5x points (hundredths, rounded half away from zero). Validation order: exactly five flex players and six distinct names (roster), salary total at most the cap (cap), players from at least two teams (teams). Return validity, first failing reason, salary and points.

split: open-access