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

N = 1
observations = []
def solve(base, corrections, deadline, weights):
    stats = dict(base)
    applied = 0
    for ts, seq, stat, value in sorted(corrections, key=lambda c: (c[0], c[1])):
        if ts // 86400 > deadline:
            continue
        stats[stat] = value
        applied += 1
    pts = sum(weights[s] * base.get(s, 0) for s in sorted(weights))
    return {'stats': stats, 'points': pts, 'applied': applied}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: points from corrected stats',
   [{'rec': 8, 'rush_yds': 20},
    [[518399, 2, 'td', 5], [367875, 1, 'td', 5], [262800, 2, 'td', 34], [345601, 2, 'td', 31],
     [432000, 0, 'td', 100]],
    4, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 3, 'points': 360, 'stats': {'rec': 8, 'rush_yds': 20, 'td': 5}}),
  ('partial repair probe: points from corrected stats',
   [{'rec': 3, 'rush_yds': 79},
    [[345601, 3, 'rec', 20], [490928, 2, 'rush_yds', 56], [345601, 2, 'rec', 66], [432000, 1, 'rec', 2],
     [345601, 3, 'td', 85]],
    4, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 3, 'points': 5279, 'stats': {'rec': 20, 'rush_yds': 79, 'td': 85}}),
  ('second regression',
   [{'rec': 3, 'rush_yds': 88, 'td': 1},
    [[518400, 0, 'rush_yds', 64], [518399, 2, 'rush_yds', 33], [456901, 2, 'td', 33],
     [349200, 1, 'rush_yds', 65], [345600, 0, 'rush_yds', 117]],
    5, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 4, 'points': 2028, 'stats': {'rec': 3, 'rush_yds': 33, 'td': 33}}),
  ('normal control 1',
   [{'rec': 2, 'rush_yds': 87, 'td': 0}, [[435600, 2, 'td', 14], [477591, 1, 'rec', 118]], 4,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 97, 'stats': {'rec': 2, 'rush_yds': 87, 'td': 0}}),
  ('normal control 2',
   [{'rec': 6, 'rush_yds': 97, 'td': 1}, [[431999, 0, 'rec', 6], [342708, 2, 'rec', 87]], 4,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 2, 'points': 187, 'stats': {'rec': 6, 'rush_yds': 97, 'td': 1}}),
  ('normal control 3',
   [{'rec': 2, 'rush_yds': 10, 'td': 0}, [[345601, 2, 'rush_yds', 102]], 3,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 20, 'stats': {'rec': 2, 'rush_yds': 10, 'td': 0}}),
  ('normal control 4',
   [{'rec': 5, 'rush_yds': 28}, [[518401, 3, 'rush_yds', 48], [522000, 1, 'rec', 94]], 5,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 53, 'stats': {'rec': 5, 'rush_yds': 28}})],
 [('regression: points from corrected stats',
   [{'rec': 0, 'rush_yds': 9},
    [[345599, 1, 'rec', 4], [345599, 1, 'rush_yds', 21], [345599, 3, 'rush_yds', 8],
     [176400, 2, 'rush_yds', 43]],
    3, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 4, 'points': 28, 'stats': {'rec': 4, 'rush_yds': 8}}),
  ('partial repair probe: points from corrected stats',
   [{'rec': 1, 'rush_yds': 14}, [[352260, 3, 'rush_yds', 5], [259199, 2, 'td', 104], [259199, 1, 'rec', 24]],
    3, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 2, 'points': 6374, 'stats': {'rec': 24, 'rush_yds': 14, 'td': 104}}),
  ('second regression',
   [{'rec': 5, 'rush_yds': 9}, [[349200, 3, 'td', 92], [345599, 3, 'td', 26]], 4,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 2, 'points': 5554, 'stats': {'rec': 5, 'rush_yds': 9, 'td': 92}}),
  ('normal control 1',
   [{'rec': 3, 'rush_yds': 114, 'td': 2}, [[432001, 3, 'td', 51]], 4, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 249, 'stats': {'rec': 3, 'rush_yds': 114, 'td': 2}}),
  ('normal control 2',
   [{'rec': 2, 'rush_yds': 100, 'td': 0}, [[432000, 2, 'rec', 101]], 4, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 110, 'stats': {'rec': 2, 'rush_yds': 100, 'td': 0}}),
  ('normal control 3',
   [{'rec': 8, 'rush_yds': 95}, [[463855, 3, 'td', 20]], 4, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 135, 'stats': {'rec': 8, 'rush_yds': 95}}),
  ('normal control 4',
   [{'rec': 6, 'rush_yds': 46}, [[349200, 2, 'td', 7], [345601, 2, 'rec', 56], [429827, 3, 'rush_yds', 35]],
    3, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 76, 'stats': {'rec': 6, 'rush_yds': 46}})],
 [('regression: points from corrected stats',
   [{'rec': 0, 'rush_yds': 17, 'td': 2},
    [[253850, 2, 'td', 22], [345600, 3, 'rush_yds', 55], [176400, 1, 'rush_yds', 69],
     [345600, 2, 'rush_yds', 105], [431999, 0, 'rec', 100]],
    3, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 2, 'points': 1389, 'stats': {'rec': 0, 'rush_yds': 69, 'td': 22}}),
  ('partial repair probe: points from corrected stats',
   [{'rec': 0, 'rush_yds': 19},
    [[435600, 3, 'td', 30], [518401, 2, 'rec', 107], [386343, 1, 'rec', 14], [431999, 0, 'td', 59]], 5,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 3, 'points': 1889, 'stats': {'rec': 14, 'rush_yds': 19, 'td': 30}}),
  ('second regression',
   [{'rec': 6, 'rush_yds': 59}, [[435600, 1, 'rec', 61], [432001, 2, 'rec', 25]], 5,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 2, 'points': 364, 'stats': {'rec': 61, 'rush_yds': 59}}),
  ('normal control 1',
   [{'rec': 2, 'rush_yds': 10, 'td': 1}, [[345600, 2, 'rush_yds', 23]], 3,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 80, 'stats': {'rec': 2, 'rush_yds': 10, 'td': 1}}),
  ('normal control 2',
   [{'rec': 5, 'rush_yds': 108, 'td': 2}, [[441899, 3, 'rush_yds', 3], [432001, 3, 'rec', 54]], 4,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 253, 'stats': {'rec': 5, 'rush_yds': 108, 'td': 2}}),
  ('normal control 3',
   [{'rec': 1, 'rush_yds': 55, 'td': 0},
    [[522000, 2, 'td', 7], [518400, 1, 'rec', 1], [432001, 0, 'rec', 1], [604799, 1, 'rush_yds', 64]], 5,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 1, 'points': 60, 'stats': {'rec': 1, 'rush_yds': 55, 'td': 0}}),
  ('normal control 4',
   [{'rec': 7, 'rush_yds': 93, 'td': 0}, [[369332, 2, 'rush_yds', 105], [345601, 0, 'rush_yds', 3]], 3,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 128, 'stats': {'rec': 7, 'rush_yds': 93, 'td': 0}})],
 [('regression: points from corrected stats',
   [{'rec': 0, 'rush_yds': 81},
    [[259200, 3, 'rec', 0], [345599, 3, 'td', 79], [431999, 3, 'rush_yds', 48], [431999, 3, 'rush_yds', 6],
     [282306, 1, 'rec', 94]],
    3, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 3, 'points': 5291, 'stats': {'rec': 94, 'rush_yds': 81, 'td': 79}}),
  ('partial repair probe: points from corrected stats',
   [{'rec': 2, 'rush_yds': 62}, [[431999, 0, 'td', 113], [431999, 0, 'rush_yds', 91]], 4,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 2, 'points': 6881, 'stats': {'rec': 2, 'rush_yds': 91, 'td': 113}}),
  ('second regression',
   [{'rec': 0, 'rush_yds': 109},
    [[345600, 2, 'rec', 53], [484186, 2, 'rec', 89], [324847, 0, 'rush_yds', 85], [345599, 2, 'td', 75]], 4,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 3, 'points': 4850, 'stats': {'rec': 53, 'rush_yds': 85, 'td': 75}}),
  ('normal control 1',
   [{'rec': 4, 'rush_yds': 76, 'td': 2}, [[522000, 3, 'td', 82]], 5, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 216, 'stats': {'rec': 4, 'rush_yds': 76, 'td': 2}}),
  ('normal control 2',
   [{'rec': 0, 'rush_yds': 0}, [[522000, 0, 'rec', 74], [518401, 1, 'td', 80]], 5,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 0, 'stats': {'rec': 0, 'rush_yds': 0}}),
  ('normal control 3',
   [{'rec': 2, 'rush_yds': 86, 'td': 1}, [[595644, 0, 'rush_yds', 103]], 5,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 156, 'stats': {'rec': 2, 'rush_yds': 86, 'td': 1}}),
  ('normal control 4',
   [{'rec': 0, 'rush_yds': 11}, [[435600, 2, 'rec', 64]], 4, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 11, 'stats': {'rec': 0, 'rush_yds': 11}})],
 [('regression: points from corrected stats',
   [{'rec': 3, 'rush_yds': 24, 'td': 2},
    [[432001, 0, 'rush_yds', 111], [259201, 0, 'rec', 83], [518399, 1, 'rec', 47]], 4,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 1, 'points': 559, 'stats': {'rec': 83, 'rush_yds': 24, 'td': 2}}),
  ('partial repair probe: points from corrected stats',
   [{'rec': 7, 'rush_yds': 118}, [[259200, 2, 'td', 115]], 3, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 1, 'points': 7053, 'stats': {'rec': 7, 'rush_yds': 118, 'td': 115}}),
  ('second regression',
   [{'rec': 0, 'rush_yds': 69, 'td': 2},
    [[345601, 0, 'rec', 97], [463841, 1, 'td', 106], [492156, 2, 'td', 21], [345599, 3, 'td', 117]], 4,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 2, 'points': 7574, 'stats': {'rec': 97, 'rush_yds': 69, 'td': 117}}),
  ('normal control 1',
   [{'rec': 3, 'rush_yds': 19, 'td': 1}, [[432000, 2, 'rec', 41]], 4, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 94, 'stats': {'rec': 3, 'rush_yds': 19, 'td': 1}}),
  ('normal control 2',
   [{'rec': 8, 'rush_yds': 18}, [[522000, 3, 'rush_yds', 102]], 5, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 58, 'stats': {'rec': 8, 'rush_yds': 18}}),
  ('normal control 3',
   [{'rec': 4, 'rush_yds': 60}, [[360154, 2, 'rush_yds', 60]], 5, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 1, 'points': 80, 'stats': {'rec': 4, 'rush_yds': 60}}),
  ('normal control 4',
   [{'rec': 0, 'rush_yds': 98}, [[535002, 2, 'rec', 116]], 5, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 98, 'stats': {'rec': 0, 'rush_yds': 98}})]]
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(base, corrections, deadline, weights):
    stats = dict(base)
    applied = 0
    for ts, seq, stat, value in sorted(corrections, key=lambda c: (c[0], c[1])):
        if ts // 86400 > deadline:
            continue
        stats[stat] = value
        applied += 1
    pts = sum(weights[s] * stats[s] for s in sorted(weights) if s in base)
    return {'stats': stats, 'points': pts, 'applied': applied}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: points from corrected stats',
   [{'rec': 8, 'rush_yds': 20},
    [[518399, 2, 'td', 5], [367875, 1, 'td', 5], [262800, 2, 'td', 34], [345601, 2, 'td', 31],
     [432000, 0, 'td', 100]],
    4, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 3, 'points': 360, 'stats': {'rec': 8, 'rush_yds': 20, 'td': 5}}),
  ('partial repair probe: points from corrected stats',
   [{'rec': 3, 'rush_yds': 79},
    [[345601, 3, 'rec', 20], [490928, 2, 'rush_yds', 56], [345601, 2, 'rec', 66], [432000, 1, 'rec', 2],
     [345601, 3, 'td', 85]],
    4, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 3, 'points': 5279, 'stats': {'rec': 20, 'rush_yds': 79, 'td': 85}}),
  ('second regression',
   [{'rec': 3, 'rush_yds': 88, 'td': 1},
    [[518400, 0, 'rush_yds', 64], [518399, 2, 'rush_yds', 33], [456901, 2, 'td', 33],
     [349200, 1, 'rush_yds', 65], [345600, 0, 'rush_yds', 117]],
    5, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 4, 'points': 2028, 'stats': {'rec': 3, 'rush_yds': 33, 'td': 33}}),
  ('normal control 1',
   [{'rec': 2, 'rush_yds': 87, 'td': 0}, [[435600, 2, 'td', 14], [477591, 1, 'rec', 118]], 4,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 97, 'stats': {'rec': 2, 'rush_yds': 87, 'td': 0}}),
  ('normal control 2',
   [{'rec': 6, 'rush_yds': 97, 'td': 1}, [[431999, 0, 'rec', 6], [342708, 2, 'rec', 87]], 4,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 2, 'points': 187, 'stats': {'rec': 6, 'rush_yds': 97, 'td': 1}}),
  ('normal control 3',
   [{'rec': 2, 'rush_yds': 10, 'td': 0}, [[345601, 2, 'rush_yds', 102]], 3,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 20, 'stats': {'rec': 2, 'rush_yds': 10, 'td': 0}}),
  ('normal control 4',
   [{'rec': 5, 'rush_yds': 28}, [[518401, 3, 'rush_yds', 48], [522000, 1, 'rec', 94]], 5,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 53, 'stats': {'rec': 5, 'rush_yds': 28}})],
 [('regression: points from corrected stats',
   [{'rec': 0, 'rush_yds': 9},
    [[345599, 1, 'rec', 4], [345599, 1, 'rush_yds', 21], [345599, 3, 'rush_yds', 8],
     [176400, 2, 'rush_yds', 43]],
    3, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 4, 'points': 28, 'stats': {'rec': 4, 'rush_yds': 8}}),
  ('partial repair probe: points from corrected stats',
   [{'rec': 1, 'rush_yds': 14}, [[352260, 3, 'rush_yds', 5], [259199, 2, 'td', 104], [259199, 1, 'rec', 24]],
    3, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 2, 'points': 6374, 'stats': {'rec': 24, 'rush_yds': 14, 'td': 104}}),
  ('second regression',
   [{'rec': 5, 'rush_yds': 9}, [[349200, 3, 'td', 92], [345599, 3, 'td', 26]], 4,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 2, 'points': 5554, 'stats': {'rec': 5, 'rush_yds': 9, 'td': 92}}),
  ('normal control 1',
   [{'rec': 3, 'rush_yds': 114, 'td': 2}, [[432001, 3, 'td', 51]], 4, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 249, 'stats': {'rec': 3, 'rush_yds': 114, 'td': 2}}),
  ('normal control 2',
   [{'rec': 2, 'rush_yds': 100, 'td': 0}, [[432000, 2, 'rec', 101]], 4, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 110, 'stats': {'rec': 2, 'rush_yds': 100, 'td': 0}}),
  ('normal control 3',
   [{'rec': 8, 'rush_yds': 95}, [[463855, 3, 'td', 20]], 4, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 135, 'stats': {'rec': 8, 'rush_yds': 95}}),
  ('normal control 4',
   [{'rec': 6, 'rush_yds': 46}, [[349200, 2, 'td', 7], [345601, 2, 'rec', 56], [429827, 3, 'rush_yds', 35]],
    3, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 76, 'stats': {'rec': 6, 'rush_yds': 46}})],
 [('regression: points from corrected stats',
   [{'rec': 0, 'rush_yds': 17, 'td': 2},
    [[253850, 2, 'td', 22], [345600, 3, 'rush_yds', 55], [176400, 1, 'rush_yds', 69],
     [345600, 2, 'rush_yds', 105], [431999, 0, 'rec', 100]],
    3, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 2, 'points': 1389, 'stats': {'rec': 0, 'rush_yds': 69, 'td': 22}}),
  ('partial repair probe: points from corrected stats',
   [{'rec': 0, 'rush_yds': 19},
    [[435600, 3, 'td', 30], [518401, 2, 'rec', 107], [386343, 1, 'rec', 14], [431999, 0, 'td', 59]], 5,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 3, 'points': 1889, 'stats': {'rec': 14, 'rush_yds': 19, 'td': 30}}),
  ('second regression',
   [{'rec': 6, 'rush_yds': 59}, [[435600, 1, 'rec', 61], [432001, 2, 'rec', 25]], 5,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 2, 'points': 364, 'stats': {'rec': 61, 'rush_yds': 59}}),
  ('normal control 1',
   [{'rec': 2, 'rush_yds': 10, 'td': 1}, [[345600, 2, 'rush_yds', 23]], 3,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 80, 'stats': {'rec': 2, 'rush_yds': 10, 'td': 1}}),
  ('normal control 2',
   [{'rec': 5, 'rush_yds': 108, 'td': 2}, [[441899, 3, 'rush_yds', 3], [432001, 3, 'rec', 54]], 4,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 253, 'stats': {'rec': 5, 'rush_yds': 108, 'td': 2}}),
  ('normal control 3',
   [{'rec': 1, 'rush_yds': 55, 'td': 0},
    [[522000, 2, 'td', 7], [518400, 1, 'rec', 1], [432001, 0, 'rec', 1], [604799, 1, 'rush_yds', 64]], 5,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 1, 'points': 60, 'stats': {'rec': 1, 'rush_yds': 55, 'td': 0}}),
  ('normal control 4',
   [{'rec': 7, 'rush_yds': 93, 'td': 0}, [[369332, 2, 'rush_yds', 105], [345601, 0, 'rush_yds', 3]], 3,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 128, 'stats': {'rec': 7, 'rush_yds': 93, 'td': 0}})],
 [('regression: points from corrected stats',
   [{'rec': 0, 'rush_yds': 81},
    [[259200, 3, 'rec', 0], [345599, 3, 'td', 79], [431999, 3, 'rush_yds', 48], [431999, 3, 'rush_yds', 6],
     [282306, 1, 'rec', 94]],
    3, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 3, 'points': 5291, 'stats': {'rec': 94, 'rush_yds': 81, 'td': 79}}),
  ('partial repair probe: points from corrected stats',
   [{'rec': 2, 'rush_yds': 62}, [[431999, 0, 'td', 113], [431999, 0, 'rush_yds', 91]], 4,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 2, 'points': 6881, 'stats': {'rec': 2, 'rush_yds': 91, 'td': 113}}),
  ('second regression',
   [{'rec': 0, 'rush_yds': 109},
    [[345600, 2, 'rec', 53], [484186, 2, 'rec', 89], [324847, 0, 'rush_yds', 85], [345599, 2, 'td', 75]], 4,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 3, 'points': 4850, 'stats': {'rec': 53, 'rush_yds': 85, 'td': 75}}),
  ('normal control 1',
   [{'rec': 4, 'rush_yds': 76, 'td': 2}, [[522000, 3, 'td', 82]], 5, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 216, 'stats': {'rec': 4, 'rush_yds': 76, 'td': 2}}),
  ('normal control 2',
   [{'rec': 0, 'rush_yds': 0}, [[522000, 0, 'rec', 74], [518401, 1, 'td', 80]], 5,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 0, 'stats': {'rec': 0, 'rush_yds': 0}}),
  ('normal control 3',
   [{'rec': 2, 'rush_yds': 86, 'td': 1}, [[595644, 0, 'rush_yds', 103]], 5,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 156, 'stats': {'rec': 2, 'rush_yds': 86, 'td': 1}}),
  ('normal control 4',
   [{'rec': 0, 'rush_yds': 11}, [[435600, 2, 'rec', 64]], 4, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 11, 'stats': {'rec': 0, 'rush_yds': 11}})],
 [('regression: points from corrected stats',
   [{'rec': 3, 'rush_yds': 24, 'td': 2},
    [[432001, 0, 'rush_yds', 111], [259201, 0, 'rec', 83], [518399, 1, 'rec', 47]], 4,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 1, 'points': 559, 'stats': {'rec': 83, 'rush_yds': 24, 'td': 2}}),
  ('partial repair probe: points from corrected stats',
   [{'rec': 7, 'rush_yds': 118}, [[259200, 2, 'td', 115]], 3, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 1, 'points': 7053, 'stats': {'rec': 7, 'rush_yds': 118, 'td': 115}}),
  ('second regression',
   [{'rec': 0, 'rush_yds': 69, 'td': 2},
    [[345601, 0, 'rec', 97], [463841, 1, 'td', 106], [492156, 2, 'td', 21], [345599, 3, 'td', 117]], 4,
    {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 2, 'points': 7574, 'stats': {'rec': 97, 'rush_yds': 69, 'td': 117}}),
  ('normal control 1',
   [{'rec': 3, 'rush_yds': 19, 'td': 1}, [[432000, 2, 'rec', 41]], 4, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 94, 'stats': {'rec': 3, 'rush_yds': 19, 'td': 1}}),
  ('normal control 2',
   [{'rec': 8, 'rush_yds': 18}, [[522000, 3, 'rush_yds', 102]], 5, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 58, 'stats': {'rec': 8, 'rush_yds': 18}}),
  ('normal control 3',
   [{'rec': 4, 'rush_yds': 60}, [[360154, 2, 'rush_yds', 60]], 5, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 1, 'points': 80, 'stats': {'rec': 4, 'rush_yds': 60}}),
  ('normal control 4',
   [{'rec': 0, 'rush_yds': 98}, [[535002, 2, 'rec', 116]], 5, {'rec': 5, 'rush_yds': 1, 'td': 60}],
   {'applied': 0, 'points': 98, 'stats': {'rec': 0, 'rush_yds': 98}})]]
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:
The stats table shows the corrected value but the points total still reflects the original.

Corrections are [timestamp seconds, per-day sequence, stat, corrected absolute value]. Apply corrections whose UTC day (timestamp // 86400) is on or before the deadline day, ordered by timestamp then sequence; each replaces the stat value (a later correction wins, a stat missing from the base line is added). Points are the weighted sum over the weight table using corrected stats. Return stats, points and the count of corrections applied.

split: open-access


meaning: Fixture-count band, not measured model difficulty

deps: stdlib

prompt:
In an eight-team league the fourth-best team is marked below the median every week.

Weekly fantasy scores are integer hundredths. Each head-to-head pair records a win/loss or a tie on equal scores (an odd team out has no head-to-head game). Every team also plays the league median: the middle score for an odd team count or the mean of the two middle scores for an even count; above the median is a win, below a loss, equal a tie. Return team -> [wins, losses, ties].

split: open-access


prompt:
A team exactly 0.005 below a half-hundredth median is recorded as a median tie.

Weekly fantasy scores are integer hundredths. Each head-to-head pair records a win/loss or a tie on equal scores (an odd team out has no head-to-head game). Every team also plays the league median: the middle score for an odd team count or the mean of the two middle scores for an even count; above the median is a win, below a loss, equal a tie. Return team -> [wins, losses, ties].

split: open-access


prompt:
The median changes when teams are listed in a different order.

Weekly fantasy scores are integer hundredths. Each head-to-head pair records a win/loss or a tie on equal scores (an odd team out has no head-to-head game). Every team also plays the league median: the middle score for an odd team count or the mean of the two middle scores for an even count; above the median is a win, below a loss, equal a tie. Return team -> [wins, losses, ties].

split: open-access


prompt:
In an odd league the median team always takes a median loss.

Weekly fantasy scores are integer hundredths. Each head-to-head pair records a win/loss or a tie on equal scores (an odd team out has no head-to-head game). Every team also plays the league median: the middle score for an odd team count or the mean of the two middle scores for an even count; above the median is a win, below a loss, equal a tie. Return team -> [wins, losses, ties].

split: open-access


prompt:
Two teams tied at 90.25 produce a win and a loss.

Weekly fantasy scores are integer hundredths. Each head-to-head pair records a win/loss or a tie on equal scores (an odd team out has no head-to-head game). Every team also plays the league median: the middle score for an odd team count or the mean of the two middle scores for an even count; above the median is a win, below a loss, equal a tie. Return team -> [wins, losses, ties].

split: open-access


prompt:
Two entries tied for first each receive the first-place prize.

Daily contest entries are [entry id, score in hundredths]; payouts[r] is the prize in cents for finishing position r (0-based), positions past the list pay 0. Entries with equal scores share the positions they jointly occupy: their prizes are summed and split equally, whole cents only, with leftover cents given one each to the tied entries in ascending id order. Return id -> cents for entries receiving more than 0.

split: open-access


prompt:
Three entries sharing 1000 cents receive 333 each and one cent is never paid.

Daily contest entries are [entry id, score in hundredths]; payouts[r] is the prize in cents for finishing position r (0-based), positions past the list pay 0. Entries with equal scores share the positions they jointly occupy: their prizes are summed and split equally, whole cents only, with leftover cents given one each to the tied entries in ascending id order. Return id -> cents for entries receiving more than 0.

split: open-access


prompt:
Entries scoring 149.95 and 149.93 are paid as if tied.

Daily contest entries are [entry id, score in hundredths]; payouts[r] is the prize in cents for finishing position r (0-based), positions past the list pay 0. Entries with equal scores share the positions they jointly occupy: their prizes are summed and split equally, whole cents only, with leftover cents given one each to the tied entries in ascending id order. Return id -> cents for entries receiving more than 0.

split: open-access


prompt:
Every non-cashing entry appears in the payout report with 0 cents.

Daily contest entries are [entry id, score in hundredths]; payouts[r] is the prize in cents for finishing position r (0-based), positions past the list pay 0. Entries with equal scores share the positions they jointly occupy: their prizes are summed and split equally, whole cents only, with leftover cents given one each to the tied entries in ascending id order. Return id -> cents for entries receiving more than 0.

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 // 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)

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 = 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)

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

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 = c // 2
    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 half-point rounding',
   [{'CPT': 'd', 'FLEX': ['a', 'f', 'g', 'h', 'b']},
    {'a': -45, 'b': -45, 'c': 1687, 'd': 2001, 'e': 0, 'f': -45, 'g': -50, 'h': 0},
    {'a': 5500, 'b': 7100, 'c': 8700, 'd': 9900, 'e': 5300, 'f': 7100, 'g': 3300, 'h': 8700},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 46500],
   {'points': 2817, 'reason': 'cap', 'salary': 46600, 'valid': False}),
  ('partial repair probe: captain half-point rounding',
   [{'CPT': 'h', 'FLEX': ['a', 'h', 'e', 'b', 'c']},
    {'a': 2370, 'b': 0, 'c': 225, 'd': 1333, 'e': 1795, 'f': 719, 'g': -50, 'h': 1795},
    {'a': 10500, 'b': 8700, 'c': 3300, 'd': 10500, 'e': 10500, 'f': 9900, 'g': 5500, 'h': 7100},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 50900],
   {'points': 8878, 'reason': 'roster', 'salary': 50800, 'valid': False}),
  ('second regression',
   [{'CPT': 'h', 'FLEX': ['g', 'f', 'c', 'b', 'e']},
    {'a': -45, 'b': 427, 'c': 2001, 'd': -50, 'e': 225, 'f': 2001, 'g': 1795, 'h': 2001},
    {'a': 5300, 'b': 5500, 'c': 5500, 'd': 3300, 'e': 8700, 'f': 5500, 'g': 5500, 'h': 5500},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 39000],
   {'points': 9451, 'reason': None, 'salary': 39000, 'valid': True}),
  ('normal control 1',
   [{'CPT': 'b', 'FLEX': ['f', 'd', 'e', 'c', 'b']},
    {'a': 225, 'b': 756, 'c': -45, 'd': 225, 'e': 0, 'f': 1333, 'g': 0, 'h': 1333},
    {'a': 7100, 'b': 8700, 'c': 9900, 'd': 8700, 'e': 7100, 'f': 3300, 'g': 10500, 'h': 8700},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50800],
   {'points': 3403, 'reason': 'roster', 'salary': 50800, 'valid': False}),
  ('normal control 2',
   [{'CPT': 'g', 'FLEX': ['c', 'a', 'd', 'g', 'f']},
    {'a': 0, 'b': 2883, 'c': 225, 'd': 1795, 'e': 1795, 'f': 1333, 'g': -50, 'h': -45},
    {'a': 3300, 'b': 5500, 'c': 3300, 'd': 10500, 'e': 3300, 'f': 8700, 'g': 5500, 'h': 5500},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 39500],
   {'points': 3228, 'reason': 'roster', 'salary': 39600, 'valid': False}),
  ('normal control 3',
   [{'CPT': 'd', 'FLEX': ['a', 'e', 'g', 'd', 'b']},
    {'a': -50, 'b': 2001, 'c': 1333, 'd': -45, 'e': 1333, 'f': 1795, 'g': 1795, 'h': 1333},
    {'a': 7100, 'b': 10500, 'c': 7100, 'd': 7100, 'e': 10500, 'f': 7100, 'g': 3300, 'h': 10500},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'A', 'h': 'A'}, 49100],
   {'points': 4966, 'reason': 'roster', 'salary': 49200, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'g', 'FLEX': ['d', 'h', 'b', 'c', 'e']},
    {'a': -50, 'b': -50, 'c': -50, 'd': 1333, 'e': 225, 'f': 2001, 'g': 1916, 'h': 1795},
    {'a': 10500, 'b': 10500, 'c': 5300, 'd': 7100, 'e': 3300, 'f': 8700, 'g': 7100, 'h': 9900},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'A'}, 50000],
   {'points': 6127, 'reason': None, 'salary': 46800, 'valid': True})],
 [('regression: captain half-point rounding',
   [{'CPT': 'g', 'FLEX': ['e', 'c', 'f', 'd', 'h']},
    {'a': 2702, 'b': -45, 'c': 0, 'd': 1333, 'e': 1333, 'f': 2001, 'g': 1333, 'h': 0},
    {'a': 7100, 'b': 8700, 'c': 5300, 'd': 9900, 'e': 9900, 'f': 8700, 'g': 8700, 'h': 8700},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'A'}, 55600],
   {'points': 6667, 'reason': None, 'salary': 55600, 'valid': True}),
  ('partial repair probe: captain half-point rounding',
   [{'CPT': 'g', 'FLEX': ['b', 'f', 'd', 'g', 'a']},
    {'a': -50, 'b': -72, 'c': 2722, 'd': 1795, 'e': -45, 'f': 225, 'g': 2255, 'h': 1795},
    {'a': 8700, 'b': 9900, 'c': 5300, 'd': 8700, 'e': 5500, 'f': 10500, 'g': 5500, 'h': 7100},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 51600],
   {'points': 7536, 'reason': 'roster', 'salary': 51600, 'valid': False}),
  ('second regression',
   [{'CPT': 'f', 'FLEX': ['f', 'c', 'h', 'f', 'd']},
    {'a': 1795, 'b': -45, 'c': 2001, 'd': 2001, 'e': 1795, 'f': 225, 'g': 2757, 'h': 225},
    {'a': 5500, 'b': 5500, 'c': 3300, 'd': 5500, 'e': 5300, 'f': 8700, 'g': 9900, 'h': 5300},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 44700],
   {'points': 5015, 'reason': 'roster', 'salary': 44600, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'g', 'FLEX': ['a', 'c', 'd', 'e', 'f']},
    {'a': 0, 'b': 2607, 'c': 1333, 'd': 225, 'e': 883, 'f': 1323, 'g': -45, 'h': 0},
    {'a': 3300, 'b': 10500, 'c': 5500, 'd': 8700, 'e': 5500, 'f': 3300, 'g': 5300, 'h': 10500},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 34300],
   {'points': 3696, 'reason': None, 'salary': 34300, 'valid': True}),
  ('normal control 2',
   [{'CPT': 'h', 'FLEX': ['h', 'f', 'a', 'b', 'g']},
    {'a': -50, 'b': 0, 'c': 1795, 'd': 759, 'e': 0, 'f': 2965, 'g': -50, 'h': 0},
    {'a': 5300, 'b': 5300, 'c': 8700, 'd': 7100, 'e': 7100, 'f': 3300, 'g': 8700, 'h': 7100},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 40400],
   {'points': 2865, 'reason': 'roster', 'salary': 40400, 'valid': False}),
  ('normal control 3',
   [{'CPT': 'd', 'FLEX': ['c', 'e', 'd', 'b', 'f']},
    {'a': 0, 'b': 1333, 'c': 1333, 'd': -45, 'e': 1078, 'f': -45, 'g': -45, 'h': 1333},
    {'a': 5500, 'b': 7100, 'c': 8700, 'd': 10500, 'e': 3300, 'f': 7100, 'g': 5300, 'h': 8700},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 52500],
   {'points': 3586, 'reason': 'roster', 'salary': 52500, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'a', 'FLEX': ['g', 'b', 'h', 'd', 'e']},
    {'a': 0, 'b': -45, 'c': 2001, 'd': 1333, 'e': 1333, 'f': 2001, 'g': 225, 'h': 0},
    {'a': 3300, 'b': 7100, 'c': 8700, 'd': 9900, 'e': 7100, 'f': 8700, 'g': 3300, 'h': 3300},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 2846, 'reason': None, 'salary': 35700, 'valid': True})],
 [('regression: captain half-point rounding',
   [{'CPT': 'g', 'FLEX': ['g', 'b', 'h', 'f', 'a']},
    {'a': 2001, 'b': 1333, 'c': 1795, 'd': 2622, 'e': 901, 'f': 1795, 'g': 1795, 'h': -50},
    {'a': 7100, 'b': 7100, 'c': 9900, 'd': 5500, 'e': 5300, 'f': 5300, 'g': 10500, 'h': 5300},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'A'}, 51100],
   {'points': 9567, 'reason': 'roster', 'salary': 51100, 'valid': False}),
  ('partial repair probe: captain half-point rounding',
   [{'CPT': 'f', 'FLEX': ['a', 'h', 'd', 'e', 'c']},
    {'a': -50, 'b': 0, 'c': 1333, 'd': 225, 'e': 0, 'f': 1795, 'g': 225, 'h': -50},
    {'a': 9900, 'b': 9900, 'c': 3300, 'd': 10500, 'e': 10500, 'f': 10500, 'g': 7100, 'h': 3300},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 53300],
   {'points': 4151, 'reason': None, 'salary': 53300, 'valid': True}),
  ('second regression',
   [{'CPT': 'a', 'FLEX': ['e', 'h', 'g', 'b', 'a']},
    {'a': 2001, 'b': 2001, 'c': 2001, 'd': -45, 'e': 672, 'f': 2001, 'g': -50, 'h': 2001},
    {'a': 5300, 'b': 8700, 'c': 8700, 'd': 8700, 'e': 5300, 'f': 10500, 'g': 8700, 'h': 9900},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 45800],
   {'points': 9627, 'reason': 'roster', 'salary': 45900, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'c', 'FLEX': ['a', 'e', 'f', 'b', 'g']},
    {'a': 2001, 'b': 1795, 'c': 0, 'd': 1333, 'e': 1333, 'f': 0, 'g': 2001, 'h': 2001},
    {'a': 5300, 'b': 8700, 'c': 5500, 'd': 8700, 'e': 5300, 'f': 7100, 'g': 10500, 'h': 3300},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 45300],
   {'points': 7130, 'reason': None, 'salary': 45200, 'valid': True}),
  ('normal control 2',
   [{'CPT': 'e', 'FLEX': ['g', 'a', 'f', 'e', 'h']},
    {'a': 2001, 'b': 1795, 'c': 2001, 'd': 225, 'e': -45, 'f': -45, 'g': 225, 'h': 225},
    {'a': 7100, 'b': 5500, 'c': 7100, 'd': 8700, 'e': 7100, 'f': 5300, 'g': 5300, 'h': 5300},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 40800],
   {'points': 2293, 'reason': 'roster', 'salary': 40800, 'valid': False}),
  ('normal control 3',
   [{'CPT': 'f', 'FLEX': ['b', 'c', 'f', 'g', 'e']},
    {'a': 680, 'b': -45, 'c': -50, 'd': -50, 'e': 1795, 'f': -50, 'g': 2001, 'h': 2001},
    {'a': 7100, 'b': 8700, 'c': 5500, 'd': 5500, 'e': 9900, 'f': 3300, 'g': 10500, 'h': 3300},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'H'}, 42800],
   {'points': 3576, 'reason': 'roster', 'salary': 42900, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'h', 'FLEX': ['d', 'a', 'h', 'c', 'g']},
    {'a': 225, 'b': 225, 'c': 225, 'd': 1333, 'e': 225, 'f': -50, 'g': 1333, 'h': 70},
    {'a': 7100, 'b': 7100, 'c': 7100, 'd': 8700, 'e': 3300, 'f': 8700, 'g': 10500, 'h': 7100},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 51300],
   {'points': 3291, 'reason': 'roster', 'salary': 51200, 'valid': False})],
 [('regression: captain half-point rounding',
   [{'CPT': 'h', 'FLEX': ['e', 'b', 'h', 'h', 'a']},
    {'a': 0, 'b': 2001, 'c': 1795, 'd': -45, 'e': 0, 'f': 1795, 'g': 2824, 'h': 2001},
    {'a': 8700, 'b': 3300, 'c': 5500, 'd': 9900, 'e': 5500, 'f': 5500, 'g': 8700, 'h': 3300},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 29100],
   {'points': 9005, 'reason': 'roster', 'salary': 29100, 'valid': False}),
  ('partial repair probe: captain half-point rounding',
   [{'CPT': 'd', 'FLEX': ['c', 'd', 'g', 'e', 'f']},
    {'a': 441, 'b': 662, 'c': -45, 'd': 1795, 'e': 225, 'f': -50, 'g': -45, 'h': 225},
    {'a': 3300, 'b': 8700, 'c': 7100, 'd': 3300, 'e': 9900, 'f': 7100, 'g': 5500, 'h': 3300},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'A', 'g': 'A', 'h': 'H'}, 37800],
   {'points': 4573, 'reason': 'roster', 'salary': 37900, 'valid': False}),
  ('second regression',
   [{'CPT': 'd', 'FLEX': ['d', 'h', 'f', 'e', 'd']},
    {'a': 2001, 'b': 893, 'c': -45, 'd': 1333, 'e': -45, 'f': 0, 'g': -45, 'h': 2686},
    {'a': 5500, 'b': 5500, 'c': 8700, 'd': 9900, 'e': 7100, 'f': 3300, 'g': 5300, 'h': 7100},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 52100],
   {'points': 7307, 'reason': 'roster', 'salary': 52200, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'c', 'FLEX': ['c', 'g', 'd', 'f', 'e']},
    {'a': -45, 'b': 2744, 'c': -45, 'd': -45, 'e': 225, 'f': -45, 'g': 2001, 'h': 0},
    {'a': 3300, 'b': 9900, 'c': 5500, 'd': 5300, 'e': 5300, 'f': 7100, 'g': 10500, 'h': 10500},
    {'a': 'A', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 41900],
   {'points': 2023, 'reason': 'roster', 'salary': 42000, 'valid': False}),
  ('normal control 2',
   [{'CPT': 'f', 'FLEX': ['f', 'e', 'h', 'b', 'c']},
    {'a': 0, 'b': -45, 'c': -50, 'd': -50, 'e': 1795, 'f': -45, 'g': 0, 'h': 2001},
    {'a': 5500, 'b': 7100, 'c': 5300, 'd': 8700, 'e': 8700, 'f': 3300, 'g': 5500, 'h': 8700},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 38100],
   {'points': 3588, 'reason': 'roster', 'salary': 38100, 'valid': False}),
  ('normal control 3',
   [{'CPT': 'd', 'FLEX': ['b', 'e', 'c', 'g', 'd']},
    {'a': 1795, 'b': -45, 'c': -50, 'd': 0, 'e': -45, 'f': 2001, 'g': 225, 'h': 1448},
    {'a': 7100, 'b': 5500, 'c': 3300, 'd': 5500, 'e': 8700, 'f': 7100, 'g': 8700, 'h': 5500},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 40000],
   {'points': 85, 'reason': 'roster', 'salary': 40000, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'f', 'FLEX': ['h', 'f', 'e', 'b', 'g']},
    {'a': 0, 'b': 1795, 'c': 225, 'd': 1795, 'e': 2001, 'f': 0, 'g': 225, 'h': 2001},
    {'a': 5500, 'b': 8700, 'c': 10500, 'd': 10500, 'e': 5300, 'f': 5500, 'g': 5300, 'h': 5300},
    {'a': 'A', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 38300],
   {'points': 6022, 'reason': 'roster', 'salary': 38400, 'valid': False})],
 [('regression: captain half-point rounding',
   [{'CPT': 'd', 'FLEX': ['f', 'g', 'd', 'b', 'h']},
    {'a': -45, 'b': 225, 'c': 1795, 'd': 1957, 'e': 1530, 'f': 1795, 'g': 2001, 'h': -45},
    {'a': 8700, 'b': 3300, 'c': 5500, 'd': 9900, 'e': 7100, 'f': 5300, 'g': 8700, 'h': 5500},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'A'}, 47700],
   {'points': 8869, 'reason': 'roster', 'salary': 47600, 'valid': False}),
  ('partial repair probe: captain half-point rounding',
   [{'CPT': 'a', 'FLEX': ['b', 'c', 'h', 'f', 'd']},
    {'a': 1795, 'b': 1795, 'c': 1586, 'd': 1333, 'e': -50, 'f': 479, 'g': -45, 'h': 1333},
    {'a': 5500, 'b': 8700, 'c': 5300, 'd': 8700, 'e': 7100, 'f': 9900, 'g': 5500, 'h': 7100},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 47900],
   {'points': 9219, 'reason': 'cap', 'salary': 48000, 'valid': False}),
  ('second regression',
   [{'CPT': 'e', 'FLEX': ['h', 'g', 'a', 'e', 'd']},
    {'a': 593, 'b': -45, 'c': 1795, 'd': 1608, 'e': 225, 'f': 143, 'g': 2001, 'h': 0},
    {'a': 9900, 'b': 7100, 'c': 8700, 'd': 9900, 'e': 5500, 'f': 10500, 'g': 5300, 'h': 7100},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'A'}, 45900],
   {'points': 4765, 'reason': 'roster', 'salary': 46000, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'e', 'FLEX': ['h', 'e', 'c', 'b', 'g']},
    {'a': 1795, 'b': 1333, 'c': 2928, 'd': 0, 'e': -50, 'f': 0, 'g': 2001, 'h': -50},
    {'a': 9900, 'b': 3300, 'c': 7100, 'd': 7100, 'e': 9900, 'f': 3300, 'g': 5500, 'h': 3300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'A', 'h': 'H'}, 50000],
   {'points': 6087, 'reason': 'roster', 'salary': 44000, 'valid': False}),
  ('normal control 2',
   [{'CPT': 'd', 'FLEX': ['f', 'a', 'c', 'g', 'e']},
    {'a': 320, 'b': 0, 'c': 1333, 'd': 2538, 'e': 1795, 'f': 225, 'g': 1333, 'h': 2001},
    {'a': 5500, 'b': 5300, 'c': 8700, 'd': 8700, 'e': 9900, 'f': 5500, 'g': 7100, 'h': 5500},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 49800],
   {'points': 8813, 'reason': None, 'salary': 49800, 'valid': True}),
  ('normal control 3',
   [{'CPT': 'h', 'FLEX': ['h', 'c', 'f', 'b', 'a']},
    {'a': 225, 'b': 0, 'c': 1795, 'd': 0, 'e': 0, 'f': -45, 'g': 2001, 'h': -50},
    {'a': 3300, 'b': 3300, 'c': 10500, 'd': 9900, 'e': 5500, 'f': 3300, 'g': 9900, 'h': 5500},
    {'a': 'A', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'H'}, 34100],
   {'points': 1850, 'reason': 'roster', 'salary': 34200, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'e', 'FLEX': ['a', 'e', 'e', 'c', 'f']},
    {'a': -50, 'b': 225, 'c': 1958, 'd': 1333, 'e': -45, 'f': 0, 'g': -45, 'h': 2001},
    {'a': 5500, 'b': 5300, 'c': 3300, 'd': 8700, 'e': 10500, 'f': 10500, 'g': 10500, 'h': 3300},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'A'}, 56200],
   {'points': 1750, 'reason': 'roster', 'salary': 56100, '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 = round(c / 2)
    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 half-point rounding',
   [{'CPT': 'd', 'FLEX': ['a', 'f', 'g', 'h', 'b']},
    {'a': -45, 'b': -45, 'c': 1687, 'd': 2001, 'e': 0, 'f': -45, 'g': -50, 'h': 0},
    {'a': 5500, 'b': 7100, 'c': 8700, 'd': 9900, 'e': 5300, 'f': 7100, 'g': 3300, 'h': 8700},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 46500],
   {'points': 2817, 'reason': 'cap', 'salary': 46600, 'valid': False}),
  ('partial repair probe: captain half-point rounding',
   [{'CPT': 'h', 'FLEX': ['a', 'h', 'e', 'b', 'c']},
    {'a': 2370, 'b': 0, 'c': 225, 'd': 1333, 'e': 1795, 'f': 719, 'g': -50, 'h': 1795},
    {'a': 10500, 'b': 8700, 'c': 3300, 'd': 10500, 'e': 10500, 'f': 9900, 'g': 5500, 'h': 7100},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 50900],
   {'points': 8878, 'reason': 'roster', 'salary': 50800, 'valid': False}),
  ('second regression',
   [{'CPT': 'h', 'FLEX': ['g', 'f', 'c', 'b', 'e']},
    {'a': -45, 'b': 427, 'c': 2001, 'd': -50, 'e': 225, 'f': 2001, 'g': 1795, 'h': 2001},
    {'a': 5300, 'b': 5500, 'c': 5500, 'd': 3300, 'e': 8700, 'f': 5500, 'g': 5500, 'h': 5500},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 39000],
   {'points': 9451, 'reason': None, 'salary': 39000, 'valid': True}),
  ('normal control 1',
   [{'CPT': 'b', 'FLEX': ['f', 'd', 'e', 'c', 'b']},
    {'a': 225, 'b': 756, 'c': -45, 'd': 225, 'e': 0, 'f': 1333, 'g': 0, 'h': 1333},
    {'a': 7100, 'b': 8700, 'c': 9900, 'd': 8700, 'e': 7100, 'f': 3300, 'g': 10500, 'h': 8700},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50800],
   {'points': 3403, 'reason': 'roster', 'salary': 50800, 'valid': False}),
  ('normal control 2',
   [{'CPT': 'g', 'FLEX': ['c', 'a', 'd', 'g', 'f']},
    {'a': 0, 'b': 2883, 'c': 225, 'd': 1795, 'e': 1795, 'f': 1333, 'g': -50, 'h': -45},
    {'a': 3300, 'b': 5500, 'c': 3300, 'd': 10500, 'e': 3300, 'f': 8700, 'g': 5500, 'h': 5500},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 39500],
   {'points': 3228, 'reason': 'roster', 'salary': 39600, 'valid': False}),
  ('normal control 3',
   [{'CPT': 'd', 'FLEX': ['a', 'e', 'g', 'd', 'b']},
    {'a': -50, 'b': 2001, 'c': 1333, 'd': -45, 'e': 1333, 'f': 1795, 'g': 1795, 'h': 1333},
    {'a': 7100, 'b': 10500, 'c': 7100, 'd': 7100, 'e': 10500, 'f': 7100, 'g': 3300, 'h': 10500},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'A', 'h': 'A'}, 49100],
   {'points': 4966, 'reason': 'roster', 'salary': 49200, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'g', 'FLEX': ['d', 'h', 'b', 'c', 'e']},
    {'a': -50, 'b': -50, 'c': -50, 'd': 1333, 'e': 225, 'f': 2001, 'g': 1916, 'h': 1795},
    {'a': 10500, 'b': 10500, 'c': 5300, 'd': 7100, 'e': 3300, 'f': 8700, 'g': 7100, 'h': 9900},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'A'}, 50000],
   {'points': 6127, 'reason': None, 'salary': 46800, 'valid': True})],
 [('regression: captain half-point rounding',
   [{'CPT': 'g', 'FLEX': ['e', 'c', 'f', 'd', 'h']},
    {'a': 2702, 'b': -45, 'c': 0, 'd': 1333, 'e': 1333, 'f': 2001, 'g': 1333, 'h': 0},
    {'a': 7100, 'b': 8700, 'c': 5300, 'd': 9900, 'e': 9900, 'f': 8700, 'g': 8700, 'h': 8700},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'A'}, 55600],
   {'points': 6667, 'reason': None, 'salary': 55600, 'valid': True}),
  ('partial repair probe: captain half-point rounding',
   [{'CPT': 'g', 'FLEX': ['b', 'f', 'd', 'g', 'a']},
    {'a': -50, 'b': -72, 'c': 2722, 'd': 1795, 'e': -45, 'f': 225, 'g': 2255, 'h': 1795},
    {'a': 8700, 'b': 9900, 'c': 5300, 'd': 8700, 'e': 5500, 'f': 10500, 'g': 5500, 'h': 7100},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 51600],
   {'points': 7536, 'reason': 'roster', 'salary': 51600, 'valid': False}),
  ('second regression',
   [{'CPT': 'f', 'FLEX': ['f', 'c', 'h', 'f', 'd']},
    {'a': 1795, 'b': -45, 'c': 2001, 'd': 2001, 'e': 1795, 'f': 225, 'g': 2757, 'h': 225},
    {'a': 5500, 'b': 5500, 'c': 3300, 'd': 5500, 'e': 5300, 'f': 8700, 'g': 9900, 'h': 5300},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 44700],
   {'points': 5015, 'reason': 'roster', 'salary': 44600, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'g', 'FLEX': ['a', 'c', 'd', 'e', 'f']},
    {'a': 0, 'b': 2607, 'c': 1333, 'd': 225, 'e': 883, 'f': 1323, 'g': -45, 'h': 0},
    {'a': 3300, 'b': 10500, 'c': 5500, 'd': 8700, 'e': 5500, 'f': 3300, 'g': 5300, 'h': 10500},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 34300],
   {'points': 3696, 'reason': None, 'salary': 34300, 'valid': True}),
  ('normal control 2',
   [{'CPT': 'h', 'FLEX': ['h', 'f', 'a', 'b', 'g']},
    {'a': -50, 'b': 0, 'c': 1795, 'd': 759, 'e': 0, 'f': 2965, 'g': -50, 'h': 0},
    {'a': 5300, 'b': 5300, 'c': 8700, 'd': 7100, 'e': 7100, 'f': 3300, 'g': 8700, 'h': 7100},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 40400],
   {'points': 2865, 'reason': 'roster', 'salary': 40400, 'valid': False}),
  ('normal control 3',
   [{'CPT': 'd', 'FLEX': ['c', 'e', 'd', 'b', 'f']},
    {'a': 0, 'b': 1333, 'c': 1333, 'd': -45, 'e': 1078, 'f': -45, 'g': -45, 'h': 1333},
    {'a': 5500, 'b': 7100, 'c': 8700, 'd': 10500, 'e': 3300, 'f': 7100, 'g': 5300, 'h': 8700},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 52500],
   {'points': 3586, 'reason': 'roster', 'salary': 52500, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'a', 'FLEX': ['g', 'b', 'h', 'd', 'e']},
    {'a': 0, 'b': -45, 'c': 2001, 'd': 1333, 'e': 1333, 'f': 2001, 'g': 225, 'h': 0},
    {'a': 3300, 'b': 7100, 'c': 8700, 'd': 9900, 'e': 7100, 'f': 8700, 'g': 3300, 'h': 3300},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
   {'points': 2846, 'reason': None, 'salary': 35700, 'valid': True})],
 [('regression: captain half-point rounding',
   [{'CPT': 'g', 'FLEX': ['g', 'b', 'h', 'f', 'a']},
    {'a': 2001, 'b': 1333, 'c': 1795, 'd': 2622, 'e': 901, 'f': 1795, 'g': 1795, 'h': -50},
    {'a': 7100, 'b': 7100, 'c': 9900, 'd': 5500, 'e': 5300, 'f': 5300, 'g': 10500, 'h': 5300},
    {'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'A'}, 51100],
   {'points': 9567, 'reason': 'roster', 'salary': 51100, 'valid': False}),
  ('partial repair probe: captain half-point rounding',
   [{'CPT': 'f', 'FLEX': ['a', 'h', 'd', 'e', 'c']},
    {'a': -50, 'b': 0, 'c': 1333, 'd': 225, 'e': 0, 'f': 1795, 'g': 225, 'h': -50},
    {'a': 9900, 'b': 9900, 'c': 3300, 'd': 10500, 'e': 10500, 'f': 10500, 'g': 7100, 'h': 3300},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 53300],
   {'points': 4151, 'reason': None, 'salary': 53300, 'valid': True}),
  ('second regression',
   [{'CPT': 'a', 'FLEX': ['e', 'h', 'g', 'b', 'a']},
    {'a': 2001, 'b': 2001, 'c': 2001, 'd': -45, 'e': 672, 'f': 2001, 'g': -50, 'h': 2001},
    {'a': 5300, 'b': 8700, 'c': 8700, 'd': 8700, 'e': 5300, 'f': 10500, 'g': 8700, 'h': 9900},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 45800],
   {'points': 9627, 'reason': 'roster', 'salary': 45900, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'c', 'FLEX': ['a', 'e', 'f', 'b', 'g']},
    {'a': 2001, 'b': 1795, 'c': 0, 'd': 1333, 'e': 1333, 'f': 0, 'g': 2001, 'h': 2001},
    {'a': 5300, 'b': 8700, 'c': 5500, 'd': 8700, 'e': 5300, 'f': 7100, 'g': 10500, 'h': 3300},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 45300],
   {'points': 7130, 'reason': None, 'salary': 45200, 'valid': True}),
  ('normal control 2',
   [{'CPT': 'e', 'FLEX': ['g', 'a', 'f', 'e', 'h']},
    {'a': 2001, 'b': 1795, 'c': 2001, 'd': 225, 'e': -45, 'f': -45, 'g': 225, 'h': 225},
    {'a': 7100, 'b': 5500, 'c': 7100, 'd': 8700, 'e': 7100, 'f': 5300, 'g': 5300, 'h': 5300},
    {'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 40800],
   {'points': 2293, 'reason': 'roster', 'salary': 40800, 'valid': False}),
  ('normal control 3',
   [{'CPT': 'f', 'FLEX': ['b', 'c', 'f', 'g', 'e']},
    {'a': 680, 'b': -45, 'c': -50, 'd': -50, 'e': 1795, 'f': -50, 'g': 2001, 'h': 2001},
    {'a': 7100, 'b': 8700, 'c': 5500, 'd': 5500, 'e': 9900, 'f': 3300, 'g': 10500, 'h': 3300},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'H'}, 42800],
   {'points': 3576, 'reason': 'roster', 'salary': 42900, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'h', 'FLEX': ['d', 'a', 'h', 'c', 'g']},
    {'a': 225, 'b': 225, 'c': 225, 'd': 1333, 'e': 225, 'f': -50, 'g': 1333, 'h': 70},
    {'a': 7100, 'b': 7100, 'c': 7100, 'd': 8700, 'e': 3300, 'f': 8700, 'g': 10500, 'h': 7100},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 51300],
   {'points': 3291, 'reason': 'roster', 'salary': 51200, 'valid': False})],
 [('regression: captain half-point rounding',
   [{'CPT': 'h', 'FLEX': ['e', 'b', 'h', 'h', 'a']},
    {'a': 0, 'b': 2001, 'c': 1795, 'd': -45, 'e': 0, 'f': 1795, 'g': 2824, 'h': 2001},
    {'a': 8700, 'b': 3300, 'c': 5500, 'd': 9900, 'e': 5500, 'f': 5500, 'g': 8700, 'h': 3300},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 29100],
   {'points': 9005, 'reason': 'roster', 'salary': 29100, 'valid': False}),
  ('partial repair probe: captain half-point rounding',
   [{'CPT': 'd', 'FLEX': ['c', 'd', 'g', 'e', 'f']},
    {'a': 441, 'b': 662, 'c': -45, 'd': 1795, 'e': 225, 'f': -50, 'g': -45, 'h': 225},
    {'a': 3300, 'b': 8700, 'c': 7100, 'd': 3300, 'e': 9900, 'f': 7100, 'g': 5500, 'h': 3300},
    {'a': 'A', 'b': 'A', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'A', 'g': 'A', 'h': 'H'}, 37800],
   {'points': 4573, 'reason': 'roster', 'salary': 37900, 'valid': False}),
  ('second regression',
   [{'CPT': 'd', 'FLEX': ['d', 'h', 'f', 'e', 'd']},
    {'a': 2001, 'b': 893, 'c': -45, 'd': 1333, 'e': -45, 'f': 0, 'g': -45, 'h': 2686},
    {'a': 5500, 'b': 5500, 'c': 8700, 'd': 9900, 'e': 7100, 'f': 3300, 'g': 5300, 'h': 7100},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 52100],
   {'points': 7307, 'reason': 'roster', 'salary': 52200, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'c', 'FLEX': ['c', 'g', 'd', 'f', 'e']},
    {'a': -45, 'b': 2744, 'c': -45, 'd': -45, 'e': 225, 'f': -45, 'g': 2001, 'h': 0},
    {'a': 3300, 'b': 9900, 'c': 5500, 'd': 5300, 'e': 5300, 'f': 7100, 'g': 10500, 'h': 10500},
    {'a': 'A', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 41900],
   {'points': 2023, 'reason': 'roster', 'salary': 42000, 'valid': False}),
  ('normal control 2',
   [{'CPT': 'f', 'FLEX': ['f', 'e', 'h', 'b', 'c']},
    {'a': 0, 'b': -45, 'c': -50, 'd': -50, 'e': 1795, 'f': -45, 'g': 0, 'h': 2001},
    {'a': 5500, 'b': 7100, 'c': 5300, 'd': 8700, 'e': 8700, 'f': 3300, 'g': 5500, 'h': 8700},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 38100],
   {'points': 3588, 'reason': 'roster', 'salary': 38100, 'valid': False}),
  ('normal control 3',
   [{'CPT': 'd', 'FLEX': ['b', 'e', 'c', 'g', 'd']},
    {'a': 1795, 'b': -45, 'c': -50, 'd': 0, 'e': -45, 'f': 2001, 'g': 225, 'h': 1448},
    {'a': 7100, 'b': 5500, 'c': 3300, 'd': 5500, 'e': 8700, 'f': 7100, 'g': 8700, 'h': 5500},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 40000],
   {'points': 85, 'reason': 'roster', 'salary': 40000, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'f', 'FLEX': ['h', 'f', 'e', 'b', 'g']},
    {'a': 0, 'b': 1795, 'c': 225, 'd': 1795, 'e': 2001, 'f': 0, 'g': 225, 'h': 2001},
    {'a': 5500, 'b': 8700, 'c': 10500, 'd': 10500, 'e': 5300, 'f': 5500, 'g': 5300, 'h': 5300},
    {'a': 'A', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 38300],
   {'points': 6022, 'reason': 'roster', 'salary': 38400, 'valid': False})],
 [('regression: captain half-point rounding',
   [{'CPT': 'd', 'FLEX': ['f', 'g', 'd', 'b', 'h']},
    {'a': -45, 'b': 225, 'c': 1795, 'd': 1957, 'e': 1530, 'f': 1795, 'g': 2001, 'h': -45},
    {'a': 8700, 'b': 3300, 'c': 5500, 'd': 9900, 'e': 7100, 'f': 5300, 'g': 8700, 'h': 5500},
    {'a': 'H', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'A'}, 47700],
   {'points': 8869, 'reason': 'roster', 'salary': 47600, 'valid': False}),
  ('partial repair probe: captain half-point rounding',
   [{'CPT': 'a', 'FLEX': ['b', 'c', 'h', 'f', 'd']},
    {'a': 1795, 'b': 1795, 'c': 1586, 'd': 1333, 'e': -50, 'f': 479, 'g': -45, 'h': 1333},
    {'a': 5500, 'b': 8700, 'c': 5300, 'd': 8700, 'e': 7100, 'f': 9900, 'g': 5500, 'h': 7100},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 47900],
   {'points': 9219, 'reason': 'cap', 'salary': 48000, 'valid': False}),
  ('second regression',
   [{'CPT': 'e', 'FLEX': ['h', 'g', 'a', 'e', 'd']},
    {'a': 593, 'b': -45, 'c': 1795, 'd': 1608, 'e': 225, 'f': 143, 'g': 2001, 'h': 0},
    {'a': 9900, 'b': 7100, 'c': 8700, 'd': 9900, 'e': 5500, 'f': 10500, 'g': 5300, 'h': 7100},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'A'}, 45900],
   {'points': 4765, 'reason': 'roster', 'salary': 46000, 'valid': False}),
  ('normal control 1',
   [{'CPT': 'e', 'FLEX': ['h', 'e', 'c', 'b', 'g']},
    {'a': 1795, 'b': 1333, 'c': 2928, 'd': 0, 'e': -50, 'f': 0, 'g': 2001, 'h': -50},
    {'a': 9900, 'b': 3300, 'c': 7100, 'd': 7100, 'e': 9900, 'f': 3300, 'g': 5500, 'h': 3300},
    {'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'A', 'h': 'H'}, 50000],
   {'points': 6087, 'reason': 'roster', 'salary': 44000, 'valid': False}),
  ('normal control 2',
   [{'CPT': 'd', 'FLEX': ['f', 'a', 'c', 'g', 'e']},
    {'a': 320, 'b': 0, 'c': 1333, 'd': 2538, 'e': 1795, 'f': 225, 'g': 1333, 'h': 2001},
    {'a': 5500, 'b': 5300, 'c': 8700, 'd': 8700, 'e': 9900, 'f': 5500, 'g': 7100, 'h': 5500},
    {'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 49800],
   {'points': 8813, 'reason': None, 'salary': 49800, 'valid': True}),
  ('normal control 3',
   [{'CPT': 'h', 'FLEX': ['h', 'c', 'f', 'b', 'a']},
    {'a': 225, 'b': 0, 'c': 1795, 'd': 0, 'e': 0, 'f': -45, 'g': 2001, 'h': -50},
    {'a': 3300, 'b': 3300, 'c': 10500, 'd': 9900, 'e': 5500, 'f': 3300, 'g': 9900, 'h': 5500},
    {'a': 'A', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'H'}, 34100],
   {'points': 1850, 'reason': 'roster', 'salary': 34200, 'valid': False}),
  ('normal control 4',
   [{'CPT': 'e', 'FLEX': ['a', 'e', 'e', 'c', 'f']},
    {'a': -50, 'b': 225, 'c': 1958, 'd': 1333, 'e': -45, 'f': 0, 'g': -45, 'h': 2001},
    {'a': 5500, 'b': 5300, 'c': 3300, 'd': 8700, 'e': 10500, 'f': 10500, 'g': 10500, 'h': 3300},
    {'a': 'H', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'A'}, 56200],
   {'points': 1750, 'reason': 'roster', 'salary': 56100, '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 captain with 13.33 points scores 19.99 instead of 20.00; negative captains lose extra.

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