FAILURE MAP
← Case archive

FA-85051 / Fantasy sports scoring / Open access

Captain salary not rounded up to the salary grid · case 01

A 5300 captain costs 7950 instead of 8000, letting over-cap lineups through.

Verified by executionVariant 1 · 6 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The 1.5x captain salary is used unrounded.

VERIFIED REPAIR

Round the 1.5x salary up to the next multiple of 100.

Unsuccessful approach: Round-half-even to the hundred sends 8250 down to 8200.

Case contract

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.

Why this case matters

Captain multipliers on both salary and points are where showdown contest lineups are mispriced or wrongly rejected.

1 / The failure

Exit 1
"""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 // 2
    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: captain salary rounding',
   [{'CPT': 'g', 'FLEX': ['d', 'h', 'g', 'g', 'a']},
    {'a': 225, 'b': 1333, 'c': 225, 'd': 2438, 'e': 0, 'f': 2001, 'g': 225, 'h': 2239},
    {'a': 8700, 'b': 10500, 'c': 5500, 'd': 9900, 'e': 3300, 'f': 5500, 'g': 10500, 'h': 7100},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'A'}, 50000],
   {'points': 5690, 'reason': 'roster', 'salary': 62500, 'valid': False}),
  ('partial repair probe: captain salary rounding',
   [{'CPT': 'a', 'FLEX': ['b', 'c', 'd', 'g', 'h']},
    {'a': 2001, 'b': 1333, 'c': 225, 'd': 20, 'e': -50, 'f': 2001, 'g': -50, 'h': 1795},
    {'a': 5500, 'b': 8700, 'c': 5500, 'd': 3300, 'e': 5500, 'f': 3300, 'g': 9900, 'h': 5300},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 6325, 'reason': None, 'salary': 41000, 'valid': True}),
  ('second regression',
   [{'CPT': 'g', 'FLEX': ['h', 'e', 'c', 'b', 'd']},
    {'a': -50, 'b': 0, 'c': 0, 'd': 1795, 'e': 225, 'f': 225, 'g': 1333, 'h': -45},
    {'a': 7100, 'b': 5300, 'c': 10500, 'd': 5300, 'e': 7100, 'f': 8700, 'g': 3300, 'h': 5500},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'H'}, 38800],
   {'points': 3975, 'reason': 'teams', 'salary': 38700, 'valid': False}),
  ('extra case 1',
   [{'CPT': 'h', 'FLEX': ['b', 'h', 'e', 'f', 'g']},
    {'a': -45, 'b': 1052, 'c': 1795, 'd': 1795, 'e': 225, 'f': 1795, 'g': 1333, 'h': -45},
    {'a': 9900, 'b': 5300, 'c': 10500, 'd': 5300, 'e': 7100, 'f': 5500, 'g': 8700, 'h': 5300},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'A', 'g': 'A', 'h': 'A'}, 39800],
   {'points': 4292, 'reason': 'roster', 'salary': 39900, 'valid': False}),
  ('extra case 2',
   [{'CPT': 'h', 'FLEX': ['d', 'e', 'c', 'h', 'f']},
    {'a': 2001, 'b': 225, 'c': 2001, 'd': 1333, 'e': -50, 'f': -50, 'g': 1333, 'h': 840},
    {'a': 3300, 'b': 8700, 'c': 5500, 'd': 5500, 'e': 8700, 'f': 7100, 'g': 3300, 'h': 3300},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 35100],
   {'points': 5334, 'reason': 'roster', 'salary': 35100, 'valid': False}),
  ('extra case 3',
   [{'CPT': 'e', 'FLEX': ['e', 'g', 'c', 'h', 'a']},
    {'a': 1795, 'b': 1121, 'c': 225, 'd': -45, 'e': 225, 'f': 0, 'g': 1333, 'h': 1333},
    {'a': 8700, 'b': 7100, 'c': 8700, 'd': 7100, 'e': 5500, 'f': 3300, 'g': 9900, 'h': 5300},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 46400],
   {'points': 5249, 'reason': 'roster', 'salary': 46400, 'valid': False})],
 [('regression: captain salary rounding',
   [{'CPT': 'g', 'FLEX': ['d', 'a', 'c', 'b', 'f']},
    {'a': -45, 'b': 0, 'c': -50, 'd': 1333, 'e': 1333, 'f': 0, 'g': 1333, 'h': 1333},
    {'a': 8700, 'b': 5500, 'c': 7100, 'd': 5300, 'e': 5300, 'f': 10500, 'g': 7100, 'h': 9900},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 47700],
   {'points': 3238, 'reason': 'cap', 'salary': 47800, 'valid': False}),
  ('partial repair probe: captain salary rounding',
   [{'CPT': 'h', 'FLEX': ['e', 'h', 'f', 'd', 'b']},
    {'a': -50, 'b': 0, 'c': 0, 'd': 225, 'e': 2001, 'f': 878, 'g': 0, 'h': 1958},
    {'a': 8700, 'b': 5500, 'c': 5300, 'd': 8700, 'e': 5500, 'f': 9900, 'g': 9900, 'h': 8700},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 51300],
   {'points': 7999, 'reason': 'roster', 'salary': 51400, 'valid': False}),
  ('second regression',
   [{'CPT': 'c', 'FLEX': ['d', 'b', 'f', 'g', 'c']},
    {'a': -45, 'b': -50, 'c': -45, 'd': 2001, 'e': 1973, 'f': 1934, 'g': -45, 'h': 0},
    {'a': 10500, 'b': 7100, 'c': 9900, 'd': 5300, 'e': 3300, 'f': 10500, 'g': 5500, 'h': 5300},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 50000],
   {'points': 3727, 'reason': 'roster', 'salary': 53200, 'valid': False}),
  ('extra case 1',
   [{'CPT': 'g', 'FLEX': ['g', 'b', 'c', 'g', 'a']},
    {'a': -50, 'b': 225, 'c': 1333, 'd': 0, 'e': 1333, 'f': 1333, 'g': 0, 'h': 225},
    {'a': 7100, 'b': 5300, 'c': 5500, 'd': 3300, 'e': 9900, 'f': 3300, 'g': 5500, 'h': 8700},
    {'a': 'A', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 50000],
   {'points': 1508, 'reason': 'roster', 'salary': 37200, 'valid': False}),
  ('extra case 2',
   [{'CPT': 'e', 'FLEX': ['b', 'e', 'c', 'f', 'e']},
    {'a': -50, 'b': 1795, 'c': -50, 'd': 156, 'e': 2576, 'f': 225, 'g': 1333, 'h': -45},
    {'a': 3300, 'b': 7100, 'c': 5300, 'd': 5500, 'e': 7100, 'f': 5300, 'g': 7100, 'h': 8700},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'A'}, 42700],
   {'points': 10986, 'reason': 'roster', 'salary': 42600, 'valid': False}),
  ('extra case 3',
   [{'CPT': 'a', 'FLEX': ['h', 'e', 'b', 'f', 'c']},
    {'a': 1795, 'b': 1795, 'c': -45, 'd': 2001, 'e': 2001, 'f': 1795, 'g': 1795, 'h': 2001},
    {'a': 5300, 'b': 8700, 'c': 5300, 'd': 3300, 'e': 5300, 'f': 9900, 'g': 7100, 'h': 5300},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'A'}, 42400],
   {'points': 10240, 'reason': 'cap', 'salary': 42500, 'valid': False})],
 [('regression: captain salary rounding',
   [{'CPT': 'd', 'FLEX': ['e', 'f', 'b', 'a', 'h']},
    {'a': -45, 'b': -45, 'c': 2001, 'd': 1795, 'e': 1850, 'f': 861, 'g': 0, 'h': 2001},
    {'a': 9900, 'b': 10500, 'c': 5500, 'd': 9900, 'e': 8700, 'f': 8700, 'g': 5500, 'h': 10500},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'A', 'h': 'A'}, 63100],
   {'points': 7315, 'reason': 'cap', 'salary': 63200, 'valid': False}),
  ('partial repair probe: captain salary rounding',
   [{'CPT': 'c', 'FLEX': ['e', 'f', 'd', 'b', 'h']},
    {'a': -45, 'b': 1795, 'c': -45, 'd': 0, 'e': -50, 'f': 0, 'g': 2001, 'h': 1795},
    {'a': 10500, 'b': 8700, 'c': 8700, 'd': 5300, 'e': 5300, 'f': 7100, 'g': 8700, 'h': 7100},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'A', 'h': 'H'}, 46500],
   {'points': 3472, 'reason': 'cap', 'salary': 46600, 'valid': False}),
  ('second regression',
   [{'CPT': 'c', 'FLEX': ['c', 'g', 'e', 'a', 'h']},
    {'a': -50, 'b': -50, 'c': 225, 'd': 0, 'e': 1333, 'f': 0, 'g': 0, 'h': 2001},
    {'a': 7100, 'b': 3300, 'c': 5300, 'd': 7100, 'e': 5300, 'f': 3300, 'g': 8700, 'h': 10500},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'H'}, 44900],
   {'points': 3847, 'reason': 'roster', 'salary': 44900, 'valid': False}),
  ('extra case 1',
   [{'CPT': 'f', 'FLEX': ['e', 'h', 'd', 'c', 'a']},
    {'a': -45, 'b': 1333, 'c': 225, 'd': 1333, 'e': 2001, 'f': 1333, 'g': 1864, 'h': 38},
    {'a': 8700, 'b': 5500, 'c': 5500, 'd': 8700, 'e': 7100, 'f': 3300, 'g': 5500, 'h': 3300},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 38400],
   {'points': 5552, 'reason': None, 'salary': 38300, 'valid': True}),
  ('extra case 2',
   [{'CPT': 'g', 'FLEX': ['a', 'f', 'b', 'g', 'e']},
    {'a': 1333, 'b': 2001, 'c': 1795, 'd': 2001, 'e': 2001, 'f': 438, 'g': 225, 'h': -50},
    {'a': 7100, 'b': 10500, 'c': 9900, 'd': 5300, 'e': 7100, 'f': 10500, 'g': 9900, 'h': 5300},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 59900],
   {'points': 6336, 'reason': 'roster', 'salary': 60000, 'valid': False}),
  ('extra case 3',
   [{'CPT': 'f', 'FLEX': ['f', 'a', 'c', 'd', 'g']},
    {'a': 225, 'b': 2001, 'c': -45, 'd': 1795, 'e': -45, 'f': 2178, 'g': 225, 'h': 0},
    {'a': 8700, 'b': 7100, 'c': 8700, 'd': 5300, 'e': 9900, 'f': 3300, 'g': 8700, 'h': 8700},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'A'}, 39800],
   {'points': 7645, 'reason': 'roster', 'salary': 39700, 'valid': False})],
 [('regression: captain salary rounding',
   [{'CPT': 'd', 'FLEX': ['f', 'h', 'a', 'b', 'c']},
    {'a': 225, 'b': 609, 'c': 0, 'd': -45, 'e': 1311, 'f': 0, 'g': 1333, 'h': 2001},
    {'a': 8700, 'b': 8700, 'c': 3300, 'd': 10500, 'e': 5500, 'f': 8700, 'g': 5500, 'h': 10500},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 55800],
   {'points': 2767, 'reason': None, 'salary': 55700, 'valid': True}),
  ('partial repair probe: captain salary rounding',
   [{'CPT': 'e', 'FLEX': ['c', 'd', 'a', 'h']},
    {'a': 1333, 'b': 0, 'c': 225, 'd': 0, 'e': 2975, 'f': -50, 'g': 2647, 'h': -45},
    {'a': 7100, 'b': 10500, 'c': 5500, 'd': 7100, 'e': 9900, 'f': 5300, 'g': 3300, 'h': 5300},
    {'a': 'A', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 40000],
   {'points': 5976, 'reason': 'roster', 'salary': 39900, 'valid': False}),
  ('second regression',
   [{'CPT': 'b', 'FLEX': ['b', 'e', 'd', 'c', 'f']},
    {'a': 1795, 'b': -50, 'c': -45, 'd': 0, 'e': 1333, 'f': 1795, 'g': 225, 'h': 225},
    {'a': 5300, 'b': 3300, 'c': 10500, 'd': 9900, 'e': 8700, 'f': 9900, 'g': 5300, 'h': 3300},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 47400],
   {'points': 2958, 'reason': 'roster', 'salary': 47300, 'valid': False}),
  ('extra case 1',
   [{'CPT': 'a', 'FLEX': ['a', 'b', 'f', 'h', 'g']},
    {'a': 968, 'b': -45, 'c': 2001, 'd': -45, 'e': -45, 'f': -45, 'g': -50, 'h': -45},
    {'a': 7100, 'b': 5300, 'c': 7100, 'd': 5500, 'e': 8700, 'f': 9900, 'g': 5300, 'h': 7100},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 45400],
   {'points': 2235, 'reason': 'roster', 'salary': 45400, 'valid': False}),
  ('extra case 2',
   [{'CPT': 'h', 'FLEX': ['f', 'b', 'e', 'g', 'a']},
    {'a': 1795, 'b': 1054, 'c': -45, 'd': 2001, 'e': 1333, 'f': -50, 'g': 1333, 'h': 365},
    {'a': 5500, 'b': 9900, 'c': 7100, 'd': 3300, 'e': 10500, 'f': 3300, 'g': 5500, 'h': 10500},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 6013, 'reason': 'cap', 'salary': 50500, 'valid': False}),
  ('extra case 3',
   [{'CPT': 'g', 'FLEX': ['c', 'a', 'b', 'f', 'e']},
    {'a': 225, 'b': 2567, 'c': -50, 'd': 225, 'e': -50, 'f': -50, 'g': -45, 'h': 1333},
    {'a': 8700, 'b': 8700, 'c': 3300, 'd': 9900, 'e': 5500, 'f': 3300, 'g': 8700, 'h': 7100},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'A'}, 50000],
   {'points': 2574, 'reason': None, 'salary': 42600, 'valid': True})],
 [('regression: captain salary rounding',
   [{'CPT': 'f', 'FLEX': ['g', 'h', 'a', 'f', 'f']},
    {'a': 1333, 'b': 2001, 'c': 1795, 'd': 1333, 'e': 0, 'f': 2001, 'g': 0, 'h': 1333},
    {'a': 10500, 'b': 8700, 'c': 3300, 'd': 10500, 'e': 5500, 'f': 10500, 'g': 8700, 'h': 5300},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'A'}, 61200],
   {'points': 9670, 'reason': 'roster', 'salary': 61300, 'valid': False}),
  ('partial repair probe: captain salary rounding',
   [{'CPT': 'a', 'FLEX': ['g', 'b', 'd', 'c', 'e']},
    {'a': 0, 'b': -50, 'c': 1701, 'd': -50, 'e': -45, 'f': 0, 'g': 2001, 'h': -50},
    {'a': 7100, 'b': 5300, 'c': 8700, 'd': 8700, 'e': 5300, 'f': 5500, 'g': 3300, 'h': 3300},
    {'a': 'A', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 50000],
   {'points': 3557, 'reason': None, 'salary': 42000, 'valid': True}),
  ('second regression',
   [{'CPT': 'h', 'FLEX': ['e', 'b', 'f', 'a', 'h']},
    {'a': -50, 'b': 225, 'c': 0, 'd': 1795, 'e': 225, 'f': -45, 'g': 1333, 'h': 1333},
    {'a': 10500, 'b': 5300, 'c': 3300, 'd': 9900, 'e': 5300, 'f': 9900, 'g': 3300, 'h': 3300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 50000],
   {'points': 3688, 'reason': 'roster', 'salary': 39300, 'valid': False}),
  ('extra case 1',
   [{'CPT': 'e', 'FLEX': ['a', 'g', 'h', 'd', 'e']},
    {'a': -50, 'b': 0, 'c': 225, 'd': -50, 'e': 1795, 'f': 2001, 'g': 0, 'h': 225},
    {'a': 8700, 'b': 5500, 'c': 3300, 'd': 5300, 'e': 8700, 'f': 10500, 'g': 10500, 'h': 8700},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 55100],
   {'points': 4613, 'reason': 'roster', 'salary': 55000, 'valid': False}),
  ('extra case 2',
   [{'CPT': 'd', 'FLEX': ['h', 'a', 'c', 'b', 'g']},
    {'a': 1560, 'b': -45, 'c': 1333, 'd': 879, 'e': -45, 'f': -50, 'g': 2001, 'h': 2001},
    {'a': 10500, 'b': 5500, 'c': 8700, 'd': 8700, 'e': 8700, 'f': 5500, 'g': 5300, 'h': 5300},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 48300],
   {'points': 8169, 'reason': 'cap', 'salary': 48400, 'valid': False}),
  ('extra case 3',
   [{'CPT': 'h', 'FLEX': ['c', 'g', 'e', 'f', 'a']},
    {'a': 2786, 'b': 1795, 'c': 2001, 'd': 1333, 'e': 1795, 'f': 0, 'g': 2001, 'h': 1333},
    {'a': 5500, 'b': 5300, 'c': 7100, 'd': 7100, 'e': 7100, 'f': 5300, 'g': 5300, 'h': 8700},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 50000],
   {'points': 10583, 'reason': None, 'salary': 43400, 'valid': True})]]
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)
Boundary fixtureActualExpectedOutcome
regression: captain salary rounding{'points': 5690, 'reason': 'roster', 'salary': 62450, 'valid': False}{'points': 5690, 'reason': 'roster', 'salary': 62500, 'valid': False}Failed
partial repair probe: captain salary rounding{'points': 6325, 'reason': None, 'salary': 40950, 'valid': True}{'points': 6325, 'reason': None, 'salary': 41000, 'valid': True}Failed
second regression{'points': 3975, 'reason': 'teams', 'salary': 38650, 'valid': False}{'points': 3975, 'reason': 'teams', 'salary': 38700, 'valid': False}Failed
extra case 1{'points': 4292, 'reason': 'roster', 'salary': 39850, 'valid': False}{'points': 4292, 'reason': 'roster', 'salary': 39900, 'valid': False}Failed
extra case 2{'points': 5334, 'reason': 'roster', 'salary': 35050, 'valid': False}{'points': 5334, 'reason': 'roster', 'salary': 35100, 'valid': False}Failed
extra case 3{'points': 5249, 'reason': 'roster', 'salary': 46350, 'valid': False}{'points': 5249, 'reason': 'roster', 'salary': 46400, 'valid': False}Failed

SHA-256 / 5451ff3f3fd7ae10a8861dad05e8be53b36df1dfb316a08a2bcc0408a57f0050

2 / The unsuccessful fix

Exit 1
"""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 = int(round(salaries[cpt] * 1.5, -2))
    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: captain salary rounding',
   [{'CPT': 'g', 'FLEX': ['d', 'h', 'g', 'g', 'a']},
    {'a': 225, 'b': 1333, 'c': 225, 'd': 2438, 'e': 0, 'f': 2001, 'g': 225, 'h': 2239},
    {'a': 8700, 'b': 10500, 'c': 5500, 'd': 9900, 'e': 3300, 'f': 5500, 'g': 10500, 'h': 7100},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'A'}, 50000],
   {'points': 5690, 'reason': 'roster', 'salary': 62500, 'valid': False}),
  ('partial repair probe: captain salary rounding',
   [{'CPT': 'a', 'FLEX': ['b', 'c', 'd', 'g', 'h']},
    {'a': 2001, 'b': 1333, 'c': 225, 'd': 20, 'e': -50, 'f': 2001, 'g': -50, 'h': 1795},
    {'a': 5500, 'b': 8700, 'c': 5500, 'd': 3300, 'e': 5500, 'f': 3300, 'g': 9900, 'h': 5300},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 6325, 'reason': None, 'salary': 41000, 'valid': True}),
  ('second regression',
   [{'CPT': 'g', 'FLEX': ['h', 'e', 'c', 'b', 'd']},
    {'a': -50, 'b': 0, 'c': 0, 'd': 1795, 'e': 225, 'f': 225, 'g': 1333, 'h': -45},
    {'a': 7100, 'b': 5300, 'c': 10500, 'd': 5300, 'e': 7100, 'f': 8700, 'g': 3300, 'h': 5500},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'H'}, 38800],
   {'points': 3975, 'reason': 'teams', 'salary': 38700, 'valid': False}),
  ('extra case 1',
   [{'CPT': 'h', 'FLEX': ['b', 'h', 'e', 'f', 'g']},
    {'a': -45, 'b': 1052, 'c': 1795, 'd': 1795, 'e': 225, 'f': 1795, 'g': 1333, 'h': -45},
    {'a': 9900, 'b': 5300, 'c': 10500, 'd': 5300, 'e': 7100, 'f': 5500, 'g': 8700, 'h': 5300},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'A', 'g': 'A', 'h': 'A'}, 39800],
   {'points': 4292, 'reason': 'roster', 'salary': 39900, 'valid': False}),
  ('extra case 2',
   [{'CPT': 'h', 'FLEX': ['d', 'e', 'c', 'h', 'f']},
    {'a': 2001, 'b': 225, 'c': 2001, 'd': 1333, 'e': -50, 'f': -50, 'g': 1333, 'h': 840},
    {'a': 3300, 'b': 8700, 'c': 5500, 'd': 5500, 'e': 8700, 'f': 7100, 'g': 3300, 'h': 3300},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 35100],
   {'points': 5334, 'reason': 'roster', 'salary': 35100, 'valid': False}),
  ('extra case 3',
   [{'CPT': 'e', 'FLEX': ['e', 'g', 'c', 'h', 'a']},
    {'a': 1795, 'b': 1121, 'c': 225, 'd': -45, 'e': 225, 'f': 0, 'g': 1333, 'h': 1333},
    {'a': 8700, 'b': 7100, 'c': 8700, 'd': 7100, 'e': 5500, 'f': 3300, 'g': 9900, 'h': 5300},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 46400],
   {'points': 5249, 'reason': 'roster', 'salary': 46400, 'valid': False})],
 [('regression: captain salary rounding',
   [{'CPT': 'g', 'FLEX': ['d', 'a', 'c', 'b', 'f']},
    {'a': -45, 'b': 0, 'c': -50, 'd': 1333, 'e': 1333, 'f': 0, 'g': 1333, 'h': 1333},
    {'a': 8700, 'b': 5500, 'c': 7100, 'd': 5300, 'e': 5300, 'f': 10500, 'g': 7100, 'h': 9900},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 47700],
   {'points': 3238, 'reason': 'cap', 'salary': 47800, 'valid': False}),
  ('partial repair probe: captain salary rounding',
   [{'CPT': 'h', 'FLEX': ['e', 'h', 'f', 'd', 'b']},
    {'a': -50, 'b': 0, 'c': 0, 'd': 225, 'e': 2001, 'f': 878, 'g': 0, 'h': 1958},
    {'a': 8700, 'b': 5500, 'c': 5300, 'd': 8700, 'e': 5500, 'f': 9900, 'g': 9900, 'h': 8700},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 51300],
   {'points': 7999, 'reason': 'roster', 'salary': 51400, 'valid': False}),
  ('second regression',
   [{'CPT': 'c', 'FLEX': ['d', 'b', 'f', 'g', 'c']},
    {'a': -45, 'b': -50, 'c': -45, 'd': 2001, 'e': 1973, 'f': 1934, 'g': -45, 'h': 0},
    {'a': 10500, 'b': 7100, 'c': 9900, 'd': 5300, 'e': 3300, 'f': 10500, 'g': 5500, 'h': 5300},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 50000],
   {'points': 3727, 'reason': 'roster', 'salary': 53200, 'valid': False}),
  ('extra case 1',
   [{'CPT': 'g', 'FLEX': ['g', 'b', 'c', 'g', 'a']},
    {'a': -50, 'b': 225, 'c': 1333, 'd': 0, 'e': 1333, 'f': 1333, 'g': 0, 'h': 225},
    {'a': 7100, 'b': 5300, 'c': 5500, 'd': 3300, 'e': 9900, 'f': 3300, 'g': 5500, 'h': 8700},
    {'a': 'A', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 50000],
   {'points': 1508, 'reason': 'roster', 'salary': 37200, 'valid': False}),
  ('extra case 2',
   [{'CPT': 'e', 'FLEX': ['b', 'e', 'c', 'f', 'e']},
    {'a': -50, 'b': 1795, 'c': -50, 'd': 156, 'e': 2576, 'f': 225, 'g': 1333, 'h': -45},
    {'a': 3300, 'b': 7100, 'c': 5300, 'd': 5500, 'e': 7100, 'f': 5300, 'g': 7100, 'h': 8700},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'A'}, 42700],
   {'points': 10986, 'reason': 'roster', 'salary': 42600, 'valid': False}),
  ('extra case 3',
   [{'CPT': 'a', 'FLEX': ['h', 'e', 'b', 'f', 'c']},
    {'a': 1795, 'b': 1795, 'c': -45, 'd': 2001, 'e': 2001, 'f': 1795, 'g': 1795, 'h': 2001},
    {'a': 5300, 'b': 8700, 'c': 5300, 'd': 3300, 'e': 5300, 'f': 9900, 'g': 7100, 'h': 5300},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'A'}, 42400],
   {'points': 10240, 'reason': 'cap', 'salary': 42500, 'valid': False})],
 [('regression: captain salary rounding',
   [{'CPT': 'd', 'FLEX': ['e', 'f', 'b', 'a', 'h']},
    {'a': -45, 'b': -45, 'c': 2001, 'd': 1795, 'e': 1850, 'f': 861, 'g': 0, 'h': 2001},
    {'a': 9900, 'b': 10500, 'c': 5500, 'd': 9900, 'e': 8700, 'f': 8700, 'g': 5500, 'h': 10500},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'A', 'h': 'A'}, 63100],
   {'points': 7315, 'reason': 'cap', 'salary': 63200, 'valid': False}),
  ('partial repair probe: captain salary rounding',
   [{'CPT': 'c', 'FLEX': ['e', 'f', 'd', 'b', 'h']},
    {'a': -45, 'b': 1795, 'c': -45, 'd': 0, 'e': -50, 'f': 0, 'g': 2001, 'h': 1795},
    {'a': 10500, 'b': 8700, 'c': 8700, 'd': 5300, 'e': 5300, 'f': 7100, 'g': 8700, 'h': 7100},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'A', 'h': 'H'}, 46500],
   {'points': 3472, 'reason': 'cap', 'salary': 46600, 'valid': False}),
  ('second regression',
   [{'CPT': 'c', 'FLEX': ['c', 'g', 'e', 'a', 'h']},
    {'a': -50, 'b': -50, 'c': 225, 'd': 0, 'e': 1333, 'f': 0, 'g': 0, 'h': 2001},
    {'a': 7100, 'b': 3300, 'c': 5300, 'd': 7100, 'e': 5300, 'f': 3300, 'g': 8700, 'h': 10500},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'H'}, 44900],
   {'points': 3847, 'reason': 'roster', 'salary': 44900, 'valid': False}),
  ('extra case 1',
   [{'CPT': 'f', 'FLEX': ['e', 'h', 'd', 'c', 'a']},
    {'a': -45, 'b': 1333, 'c': 225, 'd': 1333, 'e': 2001, 'f': 1333, 'g': 1864, 'h': 38},
    {'a': 8700, 'b': 5500, 'c': 5500, 'd': 8700, 'e': 7100, 'f': 3300, 'g': 5500, 'h': 3300},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 38400],
   {'points': 5552, 'reason': None, 'salary': 38300, 'valid': True}),
  ('extra case 2',
   [{'CPT': 'g', 'FLEX': ['a', 'f', 'b', 'g', 'e']},
    {'a': 1333, 'b': 2001, 'c': 1795, 'd': 2001, 'e': 2001, 'f': 438, 'g': 225, 'h': -50},
    {'a': 7100, 'b': 10500, 'c': 9900, 'd': 5300, 'e': 7100, 'f': 10500, 'g': 9900, 'h': 5300},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 59900],
   {'points': 6336, 'reason': 'roster', 'salary': 60000, 'valid': False}),
  ('extra case 3',
   [{'CPT': 'f', 'FLEX': ['f', 'a', 'c', 'd', 'g']},
    {'a': 225, 'b': 2001, 'c': -45, 'd': 1795, 'e': -45, 'f': 2178, 'g': 225, 'h': 0},
    {'a': 8700, 'b': 7100, 'c': 8700, 'd': 5300, 'e': 9900, 'f': 3300, 'g': 8700, 'h': 8700},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'A'}, 39800],
   {'points': 7645, 'reason': 'roster', 'salary': 39700, 'valid': False})],
 [('regression: captain salary rounding',
   [{'CPT': 'd', 'FLEX': ['f', 'h', 'a', 'b', 'c']},
    {'a': 225, 'b': 609, 'c': 0, 'd': -45, 'e': 1311, 'f': 0, 'g': 1333, 'h': 2001},
    {'a': 8700, 'b': 8700, 'c': 3300, 'd': 10500, 'e': 5500, 'f': 8700, 'g': 5500, 'h': 10500},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 55800],
   {'points': 2767, 'reason': None, 'salary': 55700, 'valid': True}),
  ('partial repair probe: captain salary rounding',
   [{'CPT': 'e', 'FLEX': ['c', 'd', 'a', 'h']},
    {'a': 1333, 'b': 0, 'c': 225, 'd': 0, 'e': 2975, 'f': -50, 'g': 2647, 'h': -45},
    {'a': 7100, 'b': 10500, 'c': 5500, 'd': 7100, 'e': 9900, 'f': 5300, 'g': 3300, 'h': 5300},
    {'a': 'A', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 40000],
   {'points': 5976, 'reason': 'roster', 'salary': 39900, 'valid': False}),
  ('second regression',
   [{'CPT': 'b', 'FLEX': ['b', 'e', 'd', 'c', 'f']},
    {'a': 1795, 'b': -50, 'c': -45, 'd': 0, 'e': 1333, 'f': 1795, 'g': 225, 'h': 225},
    {'a': 5300, 'b': 3300, 'c': 10500, 'd': 9900, 'e': 8700, 'f': 9900, 'g': 5300, 'h': 3300},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 47400],
   {'points': 2958, 'reason': 'roster', 'salary': 47300, 'valid': False}),
  ('extra case 1',
   [{'CPT': 'a', 'FLEX': ['a', 'b', 'f', 'h', 'g']},
    {'a': 968, 'b': -45, 'c': 2001, 'd': -45, 'e': -45, 'f': -45, 'g': -50, 'h': -45},
    {'a': 7100, 'b': 5300, 'c': 7100, 'd': 5500, 'e': 8700, 'f': 9900, 'g': 5300, 'h': 7100},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 45400],
   {'points': 2235, 'reason': 'roster', 'salary': 45400, 'valid': False}),
  ('extra case 2',
   [{'CPT': 'h', 'FLEX': ['f', 'b', 'e', 'g', 'a']},
    {'a': 1795, 'b': 1054, 'c': -45, 'd': 2001, 'e': 1333, 'f': -50, 'g': 1333, 'h': 365},
    {'a': 5500, 'b': 9900, 'c': 7100, 'd': 3300, 'e': 10500, 'f': 3300, 'g': 5500, 'h': 10500},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 6013, 'reason': 'cap', 'salary': 50500, 'valid': False}),
  ('extra case 3',
   [{'CPT': 'g', 'FLEX': ['c', 'a', 'b', 'f', 'e']},
    {'a': 225, 'b': 2567, 'c': -50, 'd': 225, 'e': -50, 'f': -50, 'g': -45, 'h': 1333},
    {'a': 8700, 'b': 8700, 'c': 3300, 'd': 9900, 'e': 5500, 'f': 3300, 'g': 8700, 'h': 7100},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'A'}, 50000],
   {'points': 2574, 'reason': None, 'salary': 42600, 'valid': True})],
 [('regression: captain salary rounding',
   [{'CPT': 'f', 'FLEX': ['g', 'h', 'a', 'f', 'f']},
    {'a': 1333, 'b': 2001, 'c': 1795, 'd': 1333, 'e': 0, 'f': 2001, 'g': 0, 'h': 1333},
    {'a': 10500, 'b': 8700, 'c': 3300, 'd': 10500, 'e': 5500, 'f': 10500, 'g': 8700, 'h': 5300},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'A'}, 61200],
   {'points': 9670, 'reason': 'roster', 'salary': 61300, 'valid': False}),
  ('partial repair probe: captain salary rounding',
   [{'CPT': 'a', 'FLEX': ['g', 'b', 'd', 'c', 'e']},
    {'a': 0, 'b': -50, 'c': 1701, 'd': -50, 'e': -45, 'f': 0, 'g': 2001, 'h': -50},
    {'a': 7100, 'b': 5300, 'c': 8700, 'd': 8700, 'e': 5300, 'f': 5500, 'g': 3300, 'h': 3300},
    {'a': 'A', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 50000],
   {'points': 3557, 'reason': None, 'salary': 42000, 'valid': True}),
  ('second regression',
   [{'CPT': 'h', 'FLEX': ['e', 'b', 'f', 'a', 'h']},
    {'a': -50, 'b': 225, 'c': 0, 'd': 1795, 'e': 225, 'f': -45, 'g': 1333, 'h': 1333},
    {'a': 10500, 'b': 5300, 'c': 3300, 'd': 9900, 'e': 5300, 'f': 9900, 'g': 3300, 'h': 3300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 50000],
   {'points': 3688, 'reason': 'roster', 'salary': 39300, 'valid': False}),
  ('extra case 1',
   [{'CPT': 'e', 'FLEX': ['a', 'g', 'h', 'd', 'e']},
    {'a': -50, 'b': 0, 'c': 225, 'd': -50, 'e': 1795, 'f': 2001, 'g': 0, 'h': 225},
    {'a': 8700, 'b': 5500, 'c': 3300, 'd': 5300, 'e': 8700, 'f': 10500, 'g': 10500, 'h': 8700},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 55100],
   {'points': 4613, 'reason': 'roster', 'salary': 55000, 'valid': False}),
  ('extra case 2',
   [{'CPT': 'd', 'FLEX': ['h', 'a', 'c', 'b', 'g']},
    {'a': 1560, 'b': -45, 'c': 1333, 'd': 879, 'e': -45, 'f': -50, 'g': 2001, 'h': 2001},
    {'a': 10500, 'b': 5500, 'c': 8700, 'd': 8700, 'e': 8700, 'f': 5500, 'g': 5300, 'h': 5300},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 48300],
   {'points': 8169, 'reason': 'cap', 'salary': 48400, 'valid': False}),
  ('extra case 3',
   [{'CPT': 'h', 'FLEX': ['c', 'g', 'e', 'f', 'a']},
    {'a': 2786, 'b': 1795, 'c': 2001, 'd': 1333, 'e': 1795, 'f': 0, 'g': 2001, 'h': 1333},
    {'a': 5500, 'b': 5300, 'c': 7100, 'd': 7100, 'e': 7100, 'f': 5300, 'g': 5300, 'h': 8700},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 50000],
   {'points': 10583, 'reason': None, 'salary': 43400, 'valid': True})]]
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)
Boundary fixtureActualExpectedOutcome
regression: captain salary rounding{'points': 5690, 'reason': 'roster', 'salary': 62500, 'valid': False}{'points': 5690, 'reason': 'roster', 'salary': 62500, 'valid': False}Passed
partial repair probe: captain salary rounding{'points': 6325, 'reason': None, 'salary': 40900, 'valid': True}{'points': 6325, 'reason': None, 'salary': 41000, 'valid': True}Failed
second regression{'points': 3975, 'reason': 'teams', 'salary': 38700, 'valid': False}{'points': 3975, 'reason': 'teams', 'salary': 38700, 'valid': False}Passed
extra case 1{'points': 4292, 'reason': 'roster', 'salary': 39900, 'valid': False}{'points': 4292, 'reason': 'roster', 'salary': 39900, 'valid': False}Passed
extra case 2{'points': 5334, 'reason': 'roster', 'salary': 35100, 'valid': False}{'points': 5334, 'reason': 'roster', 'salary': 35100, 'valid': False}Passed
extra case 3{'points': 5249, 'reason': 'roster', 'salary': 46300, 'valid': False}{'points': 5249, 'reason': 'roster', 'salary': 46400, 'valid': False}Failed

SHA-256 / cfa32d4c0c2dc86cd40b696d1ae247953b05b87f7cec2606027a6d9493a4be3b

3 / The verified repair

Exit 0
"""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: captain salary rounding',
   [{'CPT': 'g', 'FLEX': ['d', 'h', 'g', 'g', 'a']},
    {'a': 225, 'b': 1333, 'c': 225, 'd': 2438, 'e': 0, 'f': 2001, 'g': 225, 'h': 2239},
    {'a': 8700, 'b': 10500, 'c': 5500, 'd': 9900, 'e': 3300, 'f': 5500, 'g': 10500, 'h': 7100},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'A'}, 50000],
   {'points': 5690, 'reason': 'roster', 'salary': 62500, 'valid': False}),
  ('partial repair probe: captain salary rounding',
   [{'CPT': 'a', 'FLEX': ['b', 'c', 'd', 'g', 'h']},
    {'a': 2001, 'b': 1333, 'c': 225, 'd': 20, 'e': -50, 'f': 2001, 'g': -50, 'h': 1795},
    {'a': 5500, 'b': 8700, 'c': 5500, 'd': 3300, 'e': 5500, 'f': 3300, 'g': 9900, 'h': 5300},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 6325, 'reason': None, 'salary': 41000, 'valid': True}),
  ('second regression',
   [{'CPT': 'g', 'FLEX': ['h', 'e', 'c', 'b', 'd']},
    {'a': -50, 'b': 0, 'c': 0, 'd': 1795, 'e': 225, 'f': 225, 'g': 1333, 'h': -45},
    {'a': 7100, 'b': 5300, 'c': 10500, 'd': 5300, 'e': 7100, 'f': 8700, 'g': 3300, 'h': 5500},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'H'}, 38800],
   {'points': 3975, 'reason': 'teams', 'salary': 38700, 'valid': False}),
  ('extra case 1',
   [{'CPT': 'h', 'FLEX': ['b', 'h', 'e', 'f', 'g']},
    {'a': -45, 'b': 1052, 'c': 1795, 'd': 1795, 'e': 225, 'f': 1795, 'g': 1333, 'h': -45},
    {'a': 9900, 'b': 5300, 'c': 10500, 'd': 5300, 'e': 7100, 'f': 5500, 'g': 8700, 'h': 5300},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'A', 'g': 'A', 'h': 'A'}, 39800],
   {'points': 4292, 'reason': 'roster', 'salary': 39900, 'valid': False}),
  ('extra case 2',
   [{'CPT': 'h', 'FLEX': ['d', 'e', 'c', 'h', 'f']},
    {'a': 2001, 'b': 225, 'c': 2001, 'd': 1333, 'e': -50, 'f': -50, 'g': 1333, 'h': 840},
    {'a': 3300, 'b': 8700, 'c': 5500, 'd': 5500, 'e': 8700, 'f': 7100, 'g': 3300, 'h': 3300},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 35100],
   {'points': 5334, 'reason': 'roster', 'salary': 35100, 'valid': False}),
  ('extra case 3',
   [{'CPT': 'e', 'FLEX': ['e', 'g', 'c', 'h', 'a']},
    {'a': 1795, 'b': 1121, 'c': 225, 'd': -45, 'e': 225, 'f': 0, 'g': 1333, 'h': 1333},
    {'a': 8700, 'b': 7100, 'c': 8700, 'd': 7100, 'e': 5500, 'f': 3300, 'g': 9900, 'h': 5300},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 46400],
   {'points': 5249, 'reason': 'roster', 'salary': 46400, 'valid': False})],
 [('regression: captain salary rounding',
   [{'CPT': 'g', 'FLEX': ['d', 'a', 'c', 'b', 'f']},
    {'a': -45, 'b': 0, 'c': -50, 'd': 1333, 'e': 1333, 'f': 0, 'g': 1333, 'h': 1333},
    {'a': 8700, 'b': 5500, 'c': 7100, 'd': 5300, 'e': 5300, 'f': 10500, 'g': 7100, 'h': 9900},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 47700],
   {'points': 3238, 'reason': 'cap', 'salary': 47800, 'valid': False}),
  ('partial repair probe: captain salary rounding',
   [{'CPT': 'h', 'FLEX': ['e', 'h', 'f', 'd', 'b']},
    {'a': -50, 'b': 0, 'c': 0, 'd': 225, 'e': 2001, 'f': 878, 'g': 0, 'h': 1958},
    {'a': 8700, 'b': 5500, 'c': 5300, 'd': 8700, 'e': 5500, 'f': 9900, 'g': 9900, 'h': 8700},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 51300],
   {'points': 7999, 'reason': 'roster', 'salary': 51400, 'valid': False}),
  ('second regression',
   [{'CPT': 'c', 'FLEX': ['d', 'b', 'f', 'g', 'c']},
    {'a': -45, 'b': -50, 'c': -45, 'd': 2001, 'e': 1973, 'f': 1934, 'g': -45, 'h': 0},
    {'a': 10500, 'b': 7100, 'c': 9900, 'd': 5300, 'e': 3300, 'f': 10500, 'g': 5500, 'h': 5300},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 50000],
   {'points': 3727, 'reason': 'roster', 'salary': 53200, 'valid': False}),
  ('extra case 1',
   [{'CPT': 'g', 'FLEX': ['g', 'b', 'c', 'g', 'a']},
    {'a': -50, 'b': 225, 'c': 1333, 'd': 0, 'e': 1333, 'f': 1333, 'g': 0, 'h': 225},
    {'a': 7100, 'b': 5300, 'c': 5500, 'd': 3300, 'e': 9900, 'f': 3300, 'g': 5500, 'h': 8700},
    {'a': 'A', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 50000],
   {'points': 1508, 'reason': 'roster', 'salary': 37200, 'valid': False}),
  ('extra case 2',
   [{'CPT': 'e', 'FLEX': ['b', 'e', 'c', 'f', 'e']},
    {'a': -50, 'b': 1795, 'c': -50, 'd': 156, 'e': 2576, 'f': 225, 'g': 1333, 'h': -45},
    {'a': 3300, 'b': 7100, 'c': 5300, 'd': 5500, 'e': 7100, 'f': 5300, 'g': 7100, 'h': 8700},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'A'}, 42700],
   {'points': 10986, 'reason': 'roster', 'salary': 42600, 'valid': False}),
  ('extra case 3',
   [{'CPT': 'a', 'FLEX': ['h', 'e', 'b', 'f', 'c']},
    {'a': 1795, 'b': 1795, 'c': -45, 'd': 2001, 'e': 2001, 'f': 1795, 'g': 1795, 'h': 2001},
    {'a': 5300, 'b': 8700, 'c': 5300, 'd': 3300, 'e': 5300, 'f': 9900, 'g': 7100, 'h': 5300},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'A'}, 42400],
   {'points': 10240, 'reason': 'cap', 'salary': 42500, 'valid': False})],
 [('regression: captain salary rounding',
   [{'CPT': 'd', 'FLEX': ['e', 'f', 'b', 'a', 'h']},
    {'a': -45, 'b': -45, 'c': 2001, 'd': 1795, 'e': 1850, 'f': 861, 'g': 0, 'h': 2001},
    {'a': 9900, 'b': 10500, 'c': 5500, 'd': 9900, 'e': 8700, 'f': 8700, 'g': 5500, 'h': 10500},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'A', 'h': 'A'}, 63100],
   {'points': 7315, 'reason': 'cap', 'salary': 63200, 'valid': False}),
  ('partial repair probe: captain salary rounding',
   [{'CPT': 'c', 'FLEX': ['e', 'f', 'd', 'b', 'h']},
    {'a': -45, 'b': 1795, 'c': -45, 'd': 0, 'e': -50, 'f': 0, 'g': 2001, 'h': 1795},
    {'a': 10500, 'b': 8700, 'c': 8700, 'd': 5300, 'e': 5300, 'f': 7100, 'g': 8700, 'h': 7100},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'A', 'h': 'H'}, 46500],
   {'points': 3472, 'reason': 'cap', 'salary': 46600, 'valid': False}),
  ('second regression',
   [{'CPT': 'c', 'FLEX': ['c', 'g', 'e', 'a', 'h']},
    {'a': -50, 'b': -50, 'c': 225, 'd': 0, 'e': 1333, 'f': 0, 'g': 0, 'h': 2001},
    {'a': 7100, 'b': 3300, 'c': 5300, 'd': 7100, 'e': 5300, 'f': 3300, 'g': 8700, 'h': 10500},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'H'}, 44900],
   {'points': 3847, 'reason': 'roster', 'salary': 44900, 'valid': False}),
  ('extra case 1',
   [{'CPT': 'f', 'FLEX': ['e', 'h', 'd', 'c', 'a']},
    {'a': -45, 'b': 1333, 'c': 225, 'd': 1333, 'e': 2001, 'f': 1333, 'g': 1864, 'h': 38},
    {'a': 8700, 'b': 5500, 'c': 5500, 'd': 8700, 'e': 7100, 'f': 3300, 'g': 5500, 'h': 3300},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 38400],
   {'points': 5552, 'reason': None, 'salary': 38300, 'valid': True}),
  ('extra case 2',
   [{'CPT': 'g', 'FLEX': ['a', 'f', 'b', 'g', 'e']},
    {'a': 1333, 'b': 2001, 'c': 1795, 'd': 2001, 'e': 2001, 'f': 438, 'g': 225, 'h': -50},
    {'a': 7100, 'b': 10500, 'c': 9900, 'd': 5300, 'e': 7100, 'f': 10500, 'g': 9900, 'h': 5300},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 59900],
   {'points': 6336, 'reason': 'roster', 'salary': 60000, 'valid': False}),
  ('extra case 3',
   [{'CPT': 'f', 'FLEX': ['f', 'a', 'c', 'd', 'g']},
    {'a': 225, 'b': 2001, 'c': -45, 'd': 1795, 'e': -45, 'f': 2178, 'g': 225, 'h': 0},
    {'a': 8700, 'b': 7100, 'c': 8700, 'd': 5300, 'e': 9900, 'f': 3300, 'g': 8700, 'h': 8700},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'A'}, 39800],
   {'points': 7645, 'reason': 'roster', 'salary': 39700, 'valid': False})],
 [('regression: captain salary rounding',
   [{'CPT': 'd', 'FLEX': ['f', 'h', 'a', 'b', 'c']},
    {'a': 225, 'b': 609, 'c': 0, 'd': -45, 'e': 1311, 'f': 0, 'g': 1333, 'h': 2001},
    {'a': 8700, 'b': 8700, 'c': 3300, 'd': 10500, 'e': 5500, 'f': 8700, 'g': 5500, 'h': 10500},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 55800],
   {'points': 2767, 'reason': None, 'salary': 55700, 'valid': True}),
  ('partial repair probe: captain salary rounding',
   [{'CPT': 'e', 'FLEX': ['c', 'd', 'a', 'h']},
    {'a': 1333, 'b': 0, 'c': 225, 'd': 0, 'e': 2975, 'f': -50, 'g': 2647, 'h': -45},
    {'a': 7100, 'b': 10500, 'c': 5500, 'd': 7100, 'e': 9900, 'f': 5300, 'g': 3300, 'h': 5300},
    {'a': 'A', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 40000],
   {'points': 5976, 'reason': 'roster', 'salary': 39900, 'valid': False}),
  ('second regression',
   [{'CPT': 'b', 'FLEX': ['b', 'e', 'd', 'c', 'f']},
    {'a': 1795, 'b': -50, 'c': -45, 'd': 0, 'e': 1333, 'f': 1795, 'g': 225, 'h': 225},
    {'a': 5300, 'b': 3300, 'c': 10500, 'd': 9900, 'e': 8700, 'f': 9900, 'g': 5300, 'h': 3300},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 47400],
   {'points': 2958, 'reason': 'roster', 'salary': 47300, 'valid': False}),
  ('extra case 1',
   [{'CPT': 'a', 'FLEX': ['a', 'b', 'f', 'h', 'g']},
    {'a': 968, 'b': -45, 'c': 2001, 'd': -45, 'e': -45, 'f': -45, 'g': -50, 'h': -45},
    {'a': 7100, 'b': 5300, 'c': 7100, 'd': 5500, 'e': 8700, 'f': 9900, 'g': 5300, 'h': 7100},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 45400],
   {'points': 2235, 'reason': 'roster', 'salary': 45400, 'valid': False}),
  ('extra case 2',
   [{'CPT': 'h', 'FLEX': ['f', 'b', 'e', 'g', 'a']},
    {'a': 1795, 'b': 1054, 'c': -45, 'd': 2001, 'e': 1333, 'f': -50, 'g': 1333, 'h': 365},
    {'a': 5500, 'b': 9900, 'c': 7100, 'd': 3300, 'e': 10500, 'f': 3300, 'g': 5500, 'h': 10500},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 6013, 'reason': 'cap', 'salary': 50500, 'valid': False}),
  ('extra case 3',
   [{'CPT': 'g', 'FLEX': ['c', 'a', 'b', 'f', 'e']},
    {'a': 225, 'b': 2567, 'c': -50, 'd': 225, 'e': -50, 'f': -50, 'g': -45, 'h': 1333},
    {'a': 8700, 'b': 8700, 'c': 3300, 'd': 9900, 'e': 5500, 'f': 3300, 'g': 8700, 'h': 7100},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'A'}, 50000],
   {'points': 2574, 'reason': None, 'salary': 42600, 'valid': True})],
 [('regression: captain salary rounding',
   [{'CPT': 'f', 'FLEX': ['g', 'h', 'a', 'f', 'f']},
    {'a': 1333, 'b': 2001, 'c': 1795, 'd': 1333, 'e': 0, 'f': 2001, 'g': 0, 'h': 1333},
    {'a': 10500, 'b': 8700, 'c': 3300, 'd': 10500, 'e': 5500, 'f': 10500, 'g': 8700, 'h': 5300},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'A'}, 61200],
   {'points': 9670, 'reason': 'roster', 'salary': 61300, 'valid': False}),
  ('partial repair probe: captain salary rounding',
   [{'CPT': 'a', 'FLEX': ['g', 'b', 'd', 'c', 'e']},
    {'a': 0, 'b': -50, 'c': 1701, 'd': -50, 'e': -45, 'f': 0, 'g': 2001, 'h': -50},
    {'a': 7100, 'b': 5300, 'c': 8700, 'd': 8700, 'e': 5300, 'f': 5500, 'g': 3300, 'h': 3300},
    {'a': 'A', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 50000],
   {'points': 3557, 'reason': None, 'salary': 42000, 'valid': True}),
  ('second regression',
   [{'CPT': 'h', 'FLEX': ['e', 'b', 'f', 'a', 'h']},
    {'a': -50, 'b': 225, 'c': 0, 'd': 1795, 'e': 225, 'f': -45, 'g': 1333, 'h': 1333},
    {'a': 10500, 'b': 5300, 'c': 3300, 'd': 9900, 'e': 5300, 'f': 9900, 'g': 3300, 'h': 3300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 50000],
   {'points': 3688, 'reason': 'roster', 'salary': 39300, 'valid': False}),
  ('extra case 1',
   [{'CPT': 'e', 'FLEX': ['a', 'g', 'h', 'd', 'e']},
    {'a': -50, 'b': 0, 'c': 225, 'd': -50, 'e': 1795, 'f': 2001, 'g': 0, 'h': 225},
    {'a': 8700, 'b': 5500, 'c': 3300, 'd': 5300, 'e': 8700, 'f': 10500, 'g': 10500, 'h': 8700},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 55100],
   {'points': 4613, 'reason': 'roster', 'salary': 55000, 'valid': False}),
  ('extra case 2',
   [{'CPT': 'd', 'FLEX': ['h', 'a', 'c', 'b', 'g']},
    {'a': 1560, 'b': -45, 'c': 1333, 'd': 879, 'e': -45, 'f': -50, 'g': 2001, 'h': 2001},
    {'a': 10500, 'b': 5500, 'c': 8700, 'd': 8700, 'e': 8700, 'f': 5500, 'g': 5300, 'h': 5300},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 48300],
   {'points': 8169, 'reason': 'cap', 'salary': 48400, 'valid': False}),
  ('extra case 3',
   [{'CPT': 'h', 'FLEX': ['c', 'g', 'e', 'f', 'a']},
    {'a': 2786, 'b': 1795, 'c': 2001, 'd': 1333, 'e': 1795, 'f': 0, 'g': 2001, 'h': 1333},
    {'a': 5500, 'b': 5300, 'c': 7100, 'd': 7100, 'e': 7100, 'f': 5300, 'g': 5300, 'h': 8700},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 50000],
   {'points': 10583, 'reason': None, 'salary': 43400, 'valid': True})]]
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)
Boundary fixtureActualExpectedOutcome
regression: captain salary rounding{'points': 5690, 'reason': 'roster', 'salary': 62500, 'valid': False}{'points': 5690, 'reason': 'roster', 'salary': 62500, 'valid': False}Passed
partial repair probe: captain salary rounding{'points': 6325, 'reason': None, 'salary': 41000, 'valid': True}{'points': 6325, 'reason': None, 'salary': 41000, 'valid': True}Passed
second regression{'points': 3975, 'reason': 'teams', 'salary': 38700, 'valid': False}{'points': 3975, 'reason': 'teams', 'salary': 38700, 'valid': False}Passed
extra case 1{'points': 4292, 'reason': 'roster', 'salary': 39900, 'valid': False}{'points': 4292, 'reason': 'roster', 'salary': 39900, 'valid': False}Passed
extra case 2{'points': 5334, 'reason': 'roster', 'salary': 35100, 'valid': False}{'points': 5334, 'reason': 'roster', 'salary': 35100, 'valid': False}Passed
extra case 3{'points': 5249, 'reason': 'roster', 'salary': 46400, 'valid': False}{'points': 5249, 'reason': 'roster', 'salary': 46400, 'valid': False}Passed

SHA-256 / 3c3dfb4f4e4f0f693bffed8c63e0d0fba730df105f542cb1b8c027cb7d342db4

Verification & scope

A deterministic toy scoring contract stipulated for this example; it is not the rulebook of any real fantasy platform. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:50:36.741421+00:00.

Case digest / edca6302c54e3fb4c08cbc48b0835c7b0d372648c8aa302d9d6a02bc6e40a9ee