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

N = 1
observations = []
def solve(starters, bench, minutes, pos):
    xi = list(starters)
    used = set()
    def valid(team):
        c = {'DEF': 0, 'MID': 0, 'FWD': 0}
        for n in team:
            if pos[n] in c:
                c[pos[n]] += 1
        return c['DEF'] >= 3 and c['MID'] >= 2 and c['FWD'] >= 1
    for i, s in enumerate(starters):
        if minutes[s] > 0:
            continue
        if pos[s] == 'GK':
            g = bench[0]
            if minutes[g] > 0:
                xi[i] = g
                used.add(g)
            continue
        for b in bench[1:]:
            if b in used or minutes[b] == 0:
                continue
            trial = xi[:i] + [b] + xi[i + 1:]
            if valid(trial):
                xi[i] = b
                break
    return xi
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: used bench tracking',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'def4', 'mid0', 'mid1', 'mid2', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 0,
     'b1': 30,
     'b2': 90,
     'def0': 1,
     'def1': 1,
     'def2': 1,
     'def3': 1,
     'def4': 1,
     'fwd0': 90,
     'fwd1': 0,
     'gk1': 1,
     'gk2': 90,
     'mid0': 30,
     'mid1': 0,
     'mid2': 90},
    {'b0': 'DEF',
     'b1': 'FWD',
     'b2': 'DEF',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'def4': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'def3', 'def4', 'mid0', 'b1', 'mid2', 'fwd0', 'b2']),
  ('partial repair probe: used bench tracking',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 0,
     'b1': 90,
     'b2': 90,
     'def0': 30,
     'def1': 0,
     'def2': 1,
     'def3': 90,
     'fwd0': 30,
     'gk1': 30,
     'gk2': 90,
     'mid0': 30,
     'mid1': 0,
     'mid2': 1,
     'mid3': 30,
     'mid4': 0},
    {'b0': 'MID',
     'b1': 'FWD',
     'b2': 'DEF',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'fwd0': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID',
     'mid4': 'MID'}],
   ['gk1', 'def0', 'b1', 'def2', 'def3', 'mid0', 'b2', 'mid2', 'mid3', 'mid4', 'fwd0']),
  ('second regression',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 1,
     'b1': 0,
     'b2': 90,
     'def0': 1,
     'def1': 90,
     'def2': 0,
     'fwd0': 30,
     'fwd1': 90,
     'fwd2': 30,
     'gk1': 0,
     'gk2': 1,
     'mid0': 0,
     'mid1': 0,
     'mid2': 30,
     'mid3': 90},
    {'b0': 'MID',
     'b1': 'FWD',
     'b2': 'MID',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'fwd2': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk2', 'def0', 'def1', 'def2', 'b0', 'b2', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2']),
  ('normal control 1',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 90,
     'b1': 0,
     'b2': 1,
     'def0': 0,
     'def1': 30,
     'def2': 0,
     'fwd0': 30,
     'fwd1': 90,
     'fwd2': 30,
     'gk1': 0,
     'gk2': 1,
     'mid0': 0,
     'mid1': 1,
     'mid2': 90,
     'mid3': 30},
    {'b0': 'FWD',
     'b1': 'DEF',
     'b2': 'FWD',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'fwd2': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk2', 'def0', 'def1', 'def2', 'b0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2']),
  ('normal control 2',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 30,
     'b1': 0,
     'b2': 30,
     'def0': 90,
     'def1': 90,
     'def2': 90,
     'def3': 30,
     'fwd0': 30,
     'gk1': 0,
     'gk2': 1,
     'mid0': 30,
     'mid1': 30,
     'mid2': 1,
     'mid3': 30,
     'mid4': 0},
    {'b0': 'MID',
     'b1': 'MID',
     'b2': 'FWD',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'fwd0': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID',
     'mid4': 'MID'}],
   ['gk2', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'b0', 'fwd0']),
  ('normal control 3',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 0,
     'b1': 0,
     'b2': 0,
     'def0': 30,
     'def1': 1,
     'def2': 30,
     'def3': 90,
     'fwd0': 90,
     'gk1': 0,
     'gk2': 30,
     'mid0': 0,
     'mid1': 1,
     'mid2': 1,
     'mid3': 0,
     'mid4': 0},
    {'b0': 'FWD',
     'b1': 'FWD',
     'b2': 'DEF',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'fwd0': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID',
     'mid4': 'MID'}],
   ['gk2', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0']),
  ('normal control 4',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 1,
     'b1': 1,
     'b2': 1,
     'def0': 30,
     'def1': 30,
     'def2': 90,
     'def3': 90,
     'fwd0': 90,
     'gk1': 30,
     'gk2': 30,
     'mid0': 90,
     'mid1': 1,
     'mid2': 90,
     'mid3': 30,
     'mid4': 0},
    {'b0': 'FWD',
     'b1': 'MID',
     'b2': 'MID',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'fwd0': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID',
     'mid4': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'b0', 'fwd0'])],
 [('regression: used bench tracking',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'def4', 'mid0', 'mid1', 'mid2', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 30,
     'b1': 90,
     'b2': 30,
     'def0': 0,
     'def1': 0,
     'def2': 0,
     'def3': 30,
     'def4': 90,
     'fwd0': 1,
     'fwd1': 0,
     'gk1': 30,
     'gk2': 90,
     'mid0': 90,
     'mid1': 1,
     'mid2': 0},
    {'b0': 'MID',
     'b1': 'MID',
     'b2': 'MID',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'def4': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID'}],
   ['gk1', 'b0', 'b1', 'def2', 'def3', 'def4', 'mid0', 'mid1', 'b2', 'fwd0', 'fwd1']),
  ('partial repair probe: used bench tracking',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'def4', 'mid0', 'mid1', 'mid2', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 1,
     'b1': 0,
     'b2': 30,
     'def0': 0,
     'def1': 90,
     'def2': 30,
     'def3': 0,
     'def4': 0,
     'fwd0': 1,
     'fwd1': 1,
     'gk1': 30,
     'gk2': 30,
     'mid0': 0,
     'mid1': 30,
     'mid2': 0},
    {'b0': 'DEF',
     'b1': 'FWD',
     'b2': 'DEF',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'def4': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID'}],
   ['gk1', 'b0', 'def1', 'def2', 'b2', 'def4', 'mid0', 'mid1', 'mid2', 'fwd0', 'fwd1']),
  ('second regression',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 1,
     'b1': 1,
     'b2': 90,
     'def0': 0,
     'def1': 0,
     'def2': 30,
     'fwd0': 1,
     'fwd1': 1,
     'fwd2': 90,
     'gk1': 0,
     'gk2': 1,
     'mid0': 1,
     'mid1': 1,
     'mid2': 30,
     'mid3': 30},
    {'b0': 'MID',
     'b1': 'FWD',
     'b2': 'DEF',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'fwd2': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk2', 'b2', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2']),
  ('normal control 1',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 30,
     'b1': 1,
     'b2': 0,
     'def0': 30,
     'def1': 30,
     'def2': 30,
     'def3': 90,
     'fwd0': 1,
     'fwd1': 90,
     'gk1': 30,
     'gk2': 0,
     'mid0': 0,
     'mid1': 90,
     'mid2': 90,
     'mid3': 30},
    {'b0': 'MID',
     'b1': 'MID',
     'b2': 'DEF',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'def3', 'b0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1']),
  ('normal control 2',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 1,
     'b1': 90,
     'b2': 1,
     'def0': 90,
     'def1': 90,
     'def2': 0,
     'def3': 90,
     'fwd0': 1,
     'fwd1': 1,
     'gk1': 90,
     'gk2': 1,
     'mid0': 90,
     'mid1': 30,
     'mid2': 90,
     'mid3': 90},
    {'b0': 'DEF',
     'b1': 'DEF',
     'b2': 'FWD',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk1', 'def0', 'def1', 'b0', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1']),
  ('normal control 3',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 90,
     'b1': 30,
     'b2': 30,
     'def0': 0,
     'def1': 0,
     'def2': 30,
     'fwd0': 1,
     'fwd1': 30,
     'gk1': 0,
     'gk2': 0,
     'mid0': 0,
     'mid1': 30,
     'mid2': 90,
     'mid3': 1,
     'mid4': 30},
    {'b0': 'MID',
     'b1': 'MID',
     'b2': 'MID',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID',
     'mid4': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'b0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0', 'fwd1']),
  ('normal control 4',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'def4', 'mid0', 'mid1', 'mid2', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 90,
     'b1': 1,
     'b2': 30,
     'def0': 90,
     'def1': 1,
     'def2': 1,
     'def3': 30,
     'def4': 30,
     'fwd0': 1,
     'fwd1': 1,
     'gk1': 30,
     'gk2': 0,
     'mid0': 90,
     'mid1': 30,
     'mid2': 1},
    {'b0': 'MID',
     'b1': 'MID',
     'b2': 'DEF',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'def4': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'def3', 'def4', 'mid0', 'mid1', 'mid2', 'fwd0', 'fwd1'])],
 [('regression: used bench tracking',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 1,
     'b1': 1,
     'b2': 30,
     'def0': 1,
     'def1': 0,
     'def2': 90,
     'def3': 1,
     'fwd0': 1,
     'fwd1': 0,
     'gk1': 1,
     'gk2': 90,
     'mid0': 30,
     'mid1': 1,
     'mid2': 0,
     'mid3': 30},
    {'b0': 'DEF',
     'b1': 'FWD',
     'b2': 'MID',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk1', 'def0', 'b0', 'def2', 'def3', 'mid0', 'mid1', 'b1', 'mid3', 'fwd0', 'b2']),
  ('partial repair probe: used bench tracking',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 0,
     'b1': 90,
     'b2': 1,
     'def0': 1,
     'def1': 90,
     'def2': 30,
     'fwd0': 1,
     'fwd1': 0,
     'gk1': 0,
     'gk2': 90,
     'mid0': 0,
     'mid1': 30,
     'mid2': 30,
     'mid3': 90,
     'mid4': 90},
    {'b0': 'MID',
     'b1': 'FWD',
     'b2': 'MID',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID',
     'mid4': 'MID'}],
   ['gk2', 'def0', 'def1', 'def2', 'b1', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0', 'b2']),
  ('second regression',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 30,
     'b1': 0,
     'b2': 30,
     'def0': 90,
     'def1': 1,
     'def2': 30,
     'def3': 1,
     'fwd0': 1,
     'fwd1': 90,
     'gk1': 1,
     'gk2': 30,
     'mid0': 90,
     'mid1': 1,
     'mid2': 0,
     'mid3': 0},
    {'b0': 'FWD',
     'b1': 'DEF',
     'b2': 'MID',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'b0', 'b2', 'fwd0', 'fwd1']),
  ('normal control 1',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 1,
     'b1': 0,
     'b2': 0,
     'def0': 1,
     'def1': 30,
     'def2': 90,
     'fwd0': 1,
     'fwd1': 30,
     'gk1': 90,
     'gk2': 1,
     'mid0': 30,
     'mid1': 30,
     'mid2': 30,
     'mid3': 1,
     'mid4': 30},
    {'b0': 'MID',
     'b1': 'FWD',
     'b2': 'FWD',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID',
     'mid4': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0', 'fwd1']),
  ('normal control 2',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 90,
     'b1': 30,
     'b2': 0,
     'def0': 30,
     'def1': 90,
     'def2': 90,
     'fwd0': 1,
     'fwd1': 1,
     'fwd2': 90,
     'gk1': 90,
     'gk2': 30,
     'mid0': 1,
     'mid1': 0,
     'mid2': 1,
     'mid3': 90},
    {'b0': 'MID',
     'b1': 'FWD',
     'b2': 'DEF',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'fwd2': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'mid0', 'b0', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2']),
  ('normal control 3',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 0,
     'b1': 0,
     'b2': 1,
     'def0': 1,
     'def1': 1,
     'def2': 0,
     'fwd0': 1,
     'fwd1': 0,
     'fwd2': 90,
     'gk1': 90,
     'gk2': 0,
     'mid0': 30,
     'mid1': 1,
     'mid2': 1,
     'mid3': 30},
    {'b0': 'DEF',
     'b1': 'FWD',
     'b2': 'FWD',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'fwd2': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'b2', 'fwd2']),
  ('normal control 4',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 1,
     'b1': 90,
     'b2': 90,
     'def0': 90,
     'def1': 1,
     'def2': 30,
     'fwd0': 90,
     'fwd1': 1,
     'fwd2': 30,
     'gk1': 30,
     'gk2': 1,
     'mid0': 1,
     'mid1': 90,
     'mid2': 30,
     'mid3': 1},
    {'b0': 'FWD',
     'b1': 'DEF',
     'b2': 'FWD',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'fwd2': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2'])],
 [('regression: used bench tracking',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 0,
     'b1': 1,
     'b2': 30,
     'def0': 30,
     'def1': 0,
     'def2': 90,
     'def3': 30,
     'fwd0': 1,
     'gk1': 30,
     'gk2': 90,
     'mid0': 30,
     'mid1': 0,
     'mid2': 1,
     'mid3': 0,
     'mid4': 1},
    {'b0': 'DEF',
     'b1': 'MID',
     'b2': 'DEF',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'fwd0': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID',
     'mid4': 'MID'}],
   ['gk1', 'def0', 'b1', 'def2', 'def3', 'mid0', 'b2', 'mid2', 'mid3', 'mid4', 'fwd0']),
  ('partial repair probe: used bench tracking',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'def4', 'mid0', 'mid1', 'mid2', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 1,
     'b1': 90,
     'b2': 1,
     'def0': 30,
     'def1': 1,
     'def2': 1,
     'def3': 0,
     'def4': 0,
     'fwd0': 90,
     'fwd1': 90,
     'gk1': 1,
     'gk2': 30,
     'mid0': 1,
     'mid1': 0,
     'mid2': 0},
    {'b0': 'DEF',
     'b1': 'MID',
     'b2': 'FWD',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'def4': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'b0', 'b1', 'mid0', 'b2', 'mid2', 'fwd0', 'fwd1']),
  ('second regression',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 30,
     'b1': 30,
     'b2': 0,
     'def0': 90,
     'def1': 30,
     'def2': 0,
     'fwd0': 90,
     'fwd1': 90,
     'gk1': 0,
     'gk2': 90,
     'mid0': 1,
     'mid1': 90,
     'mid2': 0,
     'mid3': 0,
     'mid4': 1},
    {'b0': 'MID',
     'b1': 'DEF',
     'b2': 'FWD',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID',
     'mid4': 'MID'}],
   ['gk2', 'def0', 'def1', 'b1', 'mid0', 'mid1', 'b0', 'mid3', 'mid4', 'fwd0', 'fwd1']),
  ('normal control 1',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 30,
     'b1': 0,
     'b2': 30,
     'def0': 90,
     'def1': 30,
     'def2': 90,
     'fwd0': 1,
     'fwd1': 90,
     'fwd2': 30,
     'gk1': 90,
     'gk2': 90,
     'mid0': 90,
     'mid1': 90,
     'mid2': 1,
     'mid3': 30},
    {'b0': 'DEF',
     'b1': 'FWD',
     'b2': 'FWD',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'fwd2': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2']),
  ('normal control 2',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'def4', 'mid0', 'mid1', 'mid2', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 30,
     'b1': 0,
     'b2': 90,
     'def0': 1,
     'def1': 1,
     'def2': 30,
     'def3': 30,
     'def4': 0,
     'fwd0': 1,
     'fwd1': 30,
     'gk1': 90,
     'gk2': 1,
     'mid0': 30,
     'mid1': 1,
     'mid2': 1},
    {'b0': 'DEF',
     'b1': 'DEF',
     'b2': 'FWD',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'def4': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'def3', 'b0', 'mid0', 'mid1', 'mid2', 'fwd0', 'fwd1']),
  ('normal control 3',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 90,
     'b1': 1,
     'b2': 90,
     'def0': 0,
     'def1': 90,
     'def2': 90,
     'def3': 90,
     'fwd0': 30,
     'fwd1': 30,
     'gk1': 90,
     'gk2': 0,
     'mid0': 1,
     'mid1': 90,
     'mid2': 30,
     'mid3': 1},
    {'b0': 'DEF',
     'b1': 'MID',
     'b2': 'MID',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk1', 'b0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1']),
  ('normal control 4',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 0,
     'b1': 90,
     'b2': 30,
     'def0': 1,
     'def1': 30,
     'def2': 1,
     'def3': 1,
     'fwd0': 1,
     'fwd1': 30,
     'gk1': 0,
     'gk2': 1,
     'mid0': 90,
     'mid1': 30,
     'mid2': 0,
     'mid3': 30},
    {'b0': 'FWD',
     'b1': 'DEF',
     'b2': 'DEF',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk2', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'b1', 'mid3', 'fwd0', 'fwd1'])],
 [('regression: used bench tracking',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 90,
     'b1': 1,
     'b2': 1,
     'def0': 30,
     'def1': 90,
     'def2': 0,
     'fwd0': 1,
     'fwd1': 30,
     'fwd2': 1,
     'gk1': 1,
     'gk2': 90,
     'mid0': 30,
     'mid1': 0,
     'mid2': 90,
     'mid3': 1},
    {'b0': 'DEF',
     'b1': 'DEF',
     'b2': 'MID',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'fwd2': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk1', 'def0', 'def1', 'b0', 'mid0', 'b1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2']),
  ('partial repair probe: used bench tracking',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'def4', 'mid0', 'mid1', 'mid2', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 1,
     'b1': 1,
     'b2': 30,
     'def0': 90,
     'def1': 0,
     'def2': 90,
     'def3': 90,
     'def4': 1,
     'fwd0': 0,
     'fwd1': 90,
     'gk1': 1,
     'gk2': 90,
     'mid0': 90,
     'mid1': 90,
     'mid2': 1},
    {'b0': 'DEF',
     'b1': 'FWD',
     'b2': 'FWD',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'def4': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID'}],
   ['gk1', 'def0', 'b0', 'def2', 'def3', 'def4', 'mid0', 'mid1', 'mid2', 'b1', 'fwd1']),
  ('second regression',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 0,
     'b1': 1,
     'b2': 0,
     'def0': 90,
     'def1': 90,
     'def2': 90,
     'fwd0': 0,
     'fwd1': 1,
     'fwd2': 0,
     'gk1': 1,
     'gk2': 1,
     'mid0': 1,
     'mid1': 1,
     'mid2': 1,
     'mid3': 1},
    {'b0': 'MID',
     'b1': 'MID',
     'b2': 'FWD',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'fwd2': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'b1', 'fwd1', 'fwd2']),
  ('normal control 1',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 90,
     'b1': 0,
     'b2': 1,
     'def0': 0,
     'def1': 30,
     'def2': 30,
     'def3': 1,
     'fwd0': 30,
     'gk1': 1,
     'gk2': 90,
     'mid0': 90,
     'mid1': 30,
     'mid2': 90,
     'mid3': 1,
     'mid4': 90},
    {'b0': 'DEF',
     'b1': 'FWD',
     'b2': 'DEF',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'fwd0': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID',
     'mid4': 'MID'}],
   ['gk1', 'b0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0']),
  ('normal control 2',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 1,
     'b1': 90,
     'b2': 1,
     'def0': 0,
     'def1': 90,
     'def2': 1,
     'fwd0': 30,
     'fwd1': 90,
     'fwd2': 90,
     'gk1': 1,
     'gk2': 1,
     'mid0': 30,
     'mid1': 1,
     'mid2': 1,
     'mid3': 30},
    {'b0': 'FWD',
     'b1': 'FWD',
     'b2': 'MID',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'fwd2': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2']),
  ('normal control 3',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 30,
     'b1': 0,
     'b2': 1,
     'def0': 30,
     'def1': 0,
     'def2': 1,
     'def3': 30,
     'fwd0': 90,
     'gk1': 90,
     'gk2': 90,
     'mid0': 30,
     'mid1': 30,
     'mid2': 30,
     'mid3': 1,
     'mid4': 30},
    {'b0': 'MID',
     'b1': 'FWD',
     'b2': 'FWD',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'fwd0': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID',
     'mid4': 'MID'}],
   ['gk1', 'def0', 'b0', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0']),
  ('normal control 4',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 1,
     'b1': 0,
     'b2': 1,
     'def0': 90,
     'def1': 1,
     'def2': 30,
     'fwd0': 90,
     'fwd1': 0,
     'gk1': 1,
     'gk2': 1,
     'mid0': 30,
     'mid1': 90,
     'mid2': 90,
     'mid3': 1,
     'mid4': 90},
    {'b0': 'DEF',
     'b1': 'MID',
     'b2': 'FWD',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID',
     'mid4': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0', 'b0'])]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

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

N = 1
observations = []
def solve(starters, bench, minutes, pos):
    xi = list(starters)
    used = set()
    def valid(team):
        c = {'DEF': 0, 'MID': 0, 'FWD': 0}
        for n in team:
            if pos[n] in c:
                c[pos[n]] += 1
        return c['DEF'] >= 3 and c['MID'] >= 2 and c['FWD'] >= 1
    for i, s in enumerate(starters):
        if minutes[s] > 0:
            continue
        if pos[s] == 'GK':
            g = bench[0]
            if minutes[g] > 0:
                xi[i] = g
                used.add(g)
            continue
        for b in bench[1:]:
            if b in used or minutes[b] == 0:
                continue
            trial = xi[:i] + [b] + xi[i + 1:]
            if valid(trial):
                xi[i] = b
                used.add(s)
                break
    return xi
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: used bench tracking',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'def4', 'mid0', 'mid1', 'mid2', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 0,
     'b1': 30,
     'b2': 90,
     'def0': 1,
     'def1': 1,
     'def2': 1,
     'def3': 1,
     'def4': 1,
     'fwd0': 90,
     'fwd1': 0,
     'gk1': 1,
     'gk2': 90,
     'mid0': 30,
     'mid1': 0,
     'mid2': 90},
    {'b0': 'DEF',
     'b1': 'FWD',
     'b2': 'DEF',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'def4': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'def3', 'def4', 'mid0', 'b1', 'mid2', 'fwd0', 'b2']),
  ('partial repair probe: used bench tracking',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 0,
     'b1': 90,
     'b2': 90,
     'def0': 30,
     'def1': 0,
     'def2': 1,
     'def3': 90,
     'fwd0': 30,
     'gk1': 30,
     'gk2': 90,
     'mid0': 30,
     'mid1': 0,
     'mid2': 1,
     'mid3': 30,
     'mid4': 0},
    {'b0': 'MID',
     'b1': 'FWD',
     'b2': 'DEF',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'fwd0': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID',
     'mid4': 'MID'}],
   ['gk1', 'def0', 'b1', 'def2', 'def3', 'mid0', 'b2', 'mid2', 'mid3', 'mid4', 'fwd0']),
  ('second regression',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 1,
     'b1': 0,
     'b2': 90,
     'def0': 1,
     'def1': 90,
     'def2': 0,
     'fwd0': 30,
     'fwd1': 90,
     'fwd2': 30,
     'gk1': 0,
     'gk2': 1,
     'mid0': 0,
     'mid1': 0,
     'mid2': 30,
     'mid3': 90},
    {'b0': 'MID',
     'b1': 'FWD',
     'b2': 'MID',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'fwd2': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk2', 'def0', 'def1', 'def2', 'b0', 'b2', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2']),
  ('normal control 1',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 90,
     'b1': 0,
     'b2': 1,
     'def0': 0,
     'def1': 30,
     'def2': 0,
     'fwd0': 30,
     'fwd1': 90,
     'fwd2': 30,
     'gk1': 0,
     'gk2': 1,
     'mid0': 0,
     'mid1': 1,
     'mid2': 90,
     'mid3': 30},
    {'b0': 'FWD',
     'b1': 'DEF',
     'b2': 'FWD',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'fwd2': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk2', 'def0', 'def1', 'def2', 'b0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2']),
  ('normal control 2',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 30,
     'b1': 0,
     'b2': 30,
     'def0': 90,
     'def1': 90,
     'def2': 90,
     'def3': 30,
     'fwd0': 30,
     'gk1': 0,
     'gk2': 1,
     'mid0': 30,
     'mid1': 30,
     'mid2': 1,
     'mid3': 30,
     'mid4': 0},
    {'b0': 'MID',
     'b1': 'MID',
     'b2': 'FWD',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'fwd0': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID',
     'mid4': 'MID'}],
   ['gk2', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'b0', 'fwd0']),
  ('normal control 3',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 0,
     'b1': 0,
     'b2': 0,
     'def0': 30,
     'def1': 1,
     'def2': 30,
     'def3': 90,
     'fwd0': 90,
     'gk1': 0,
     'gk2': 30,
     'mid0': 0,
     'mid1': 1,
     'mid2': 1,
     'mid3': 0,
     'mid4': 0},
    {'b0': 'FWD',
     'b1': 'FWD',
     'b2': 'DEF',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'fwd0': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID',
     'mid4': 'MID'}],
   ['gk2', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0']),
  ('normal control 4',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 1,
     'b1': 1,
     'b2': 1,
     'def0': 30,
     'def1': 30,
     'def2': 90,
     'def3': 90,
     'fwd0': 90,
     'gk1': 30,
     'gk2': 30,
     'mid0': 90,
     'mid1': 1,
     'mid2': 90,
     'mid3': 30,
     'mid4': 0},
    {'b0': 'FWD',
     'b1': 'MID',
     'b2': 'MID',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'fwd0': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID',
     'mid4': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'b0', 'fwd0'])],
 [('regression: used bench tracking',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'def4', 'mid0', 'mid1', 'mid2', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 30,
     'b1': 90,
     'b2': 30,
     'def0': 0,
     'def1': 0,
     'def2': 0,
     'def3': 30,
     'def4': 90,
     'fwd0': 1,
     'fwd1': 0,
     'gk1': 30,
     'gk2': 90,
     'mid0': 90,
     'mid1': 1,
     'mid2': 0},
    {'b0': 'MID',
     'b1': 'MID',
     'b2': 'MID',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'def4': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID'}],
   ['gk1', 'b0', 'b1', 'def2', 'def3', 'def4', 'mid0', 'mid1', 'b2', 'fwd0', 'fwd1']),
  ('partial repair probe: used bench tracking',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'def4', 'mid0', 'mid1', 'mid2', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 1,
     'b1': 0,
     'b2': 30,
     'def0': 0,
     'def1': 90,
     'def2': 30,
     'def3': 0,
     'def4': 0,
     'fwd0': 1,
     'fwd1': 1,
     'gk1': 30,
     'gk2': 30,
     'mid0': 0,
     'mid1': 30,
     'mid2': 0},
    {'b0': 'DEF',
     'b1': 'FWD',
     'b2': 'DEF',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'def4': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID'}],
   ['gk1', 'b0', 'def1', 'def2', 'b2', 'def4', 'mid0', 'mid1', 'mid2', 'fwd0', 'fwd1']),
  ('second regression',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 1,
     'b1': 1,
     'b2': 90,
     'def0': 0,
     'def1': 0,
     'def2': 30,
     'fwd0': 1,
     'fwd1': 1,
     'fwd2': 90,
     'gk1': 0,
     'gk2': 1,
     'mid0': 1,
     'mid1': 1,
     'mid2': 30,
     'mid3': 30},
    {'b0': 'MID',
     'b1': 'FWD',
     'b2': 'DEF',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'fwd2': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk2', 'b2', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2']),
  ('normal control 1',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 30,
     'b1': 1,
     'b2': 0,
     'def0': 30,
     'def1': 30,
     'def2': 30,
     'def3': 90,
     'fwd0': 1,
     'fwd1': 90,
     'gk1': 30,
     'gk2': 0,
     'mid0': 0,
     'mid1': 90,
     'mid2': 90,
     'mid3': 30},
    {'b0': 'MID',
     'b1': 'MID',
     'b2': 'DEF',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'def3', 'b0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1']),
  ('normal control 2',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 1,
     'b1': 90,
     'b2': 1,
     'def0': 90,
     'def1': 90,
     'def2': 0,
     'def3': 90,
     'fwd0': 1,
     'fwd1': 1,
     'gk1': 90,
     'gk2': 1,
     'mid0': 90,
     'mid1': 30,
     'mid2': 90,
     'mid3': 90},
    {'b0': 'DEF',
     'b1': 'DEF',
     'b2': 'FWD',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk1', 'def0', 'def1', 'b0', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1']),
  ('normal control 3',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 90,
     'b1': 30,
     'b2': 30,
     'def0': 0,
     'def1': 0,
     'def2': 30,
     'fwd0': 1,
     'fwd1': 30,
     'gk1': 0,
     'gk2': 0,
     'mid0': 0,
     'mid1': 30,
     'mid2': 90,
     'mid3': 1,
     'mid4': 30},
    {'b0': 'MID',
     'b1': 'MID',
     'b2': 'MID',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID',
     'mid4': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'b0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0', 'fwd1']),
  ('normal control 4',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'def4', 'mid0', 'mid1', 'mid2', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 90,
     'b1': 1,
     'b2': 30,
     'def0': 90,
     'def1': 1,
     'def2': 1,
     'def3': 30,
     'def4': 30,
     'fwd0': 1,
     'fwd1': 1,
     'gk1': 30,
     'gk2': 0,
     'mid0': 90,
     'mid1': 30,
     'mid2': 1},
    {'b0': 'MID',
     'b1': 'MID',
     'b2': 'DEF',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'def4': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'def3', 'def4', 'mid0', 'mid1', 'mid2', 'fwd0', 'fwd1'])],
 [('regression: used bench tracking',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 1,
     'b1': 1,
     'b2': 30,
     'def0': 1,
     'def1': 0,
     'def2': 90,
     'def3': 1,
     'fwd0': 1,
     'fwd1': 0,
     'gk1': 1,
     'gk2': 90,
     'mid0': 30,
     'mid1': 1,
     'mid2': 0,
     'mid3': 30},
    {'b0': 'DEF',
     'b1': 'FWD',
     'b2': 'MID',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk1', 'def0', 'b0', 'def2', 'def3', 'mid0', 'mid1', 'b1', 'mid3', 'fwd0', 'b2']),
  ('partial repair probe: used bench tracking',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 0,
     'b1': 90,
     'b2': 1,
     'def0': 1,
     'def1': 90,
     'def2': 30,
     'fwd0': 1,
     'fwd1': 0,
     'gk1': 0,
     'gk2': 90,
     'mid0': 0,
     'mid1': 30,
     'mid2': 30,
     'mid3': 90,
     'mid4': 90},
    {'b0': 'MID',
     'b1': 'FWD',
     'b2': 'MID',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID',
     'mid4': 'MID'}],
   ['gk2', 'def0', 'def1', 'def2', 'b1', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0', 'b2']),
  ('second regression',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 30,
     'b1': 0,
     'b2': 30,
     'def0': 90,
     'def1': 1,
     'def2': 30,
     'def3': 1,
     'fwd0': 1,
     'fwd1': 90,
     'gk1': 1,
     'gk2': 30,
     'mid0': 90,
     'mid1': 1,
     'mid2': 0,
     'mid3': 0},
    {'b0': 'FWD',
     'b1': 'DEF',
     'b2': 'MID',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'b0', 'b2', 'fwd0', 'fwd1']),
  ('normal control 1',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 1,
     'b1': 0,
     'b2': 0,
     'def0': 1,
     'def1': 30,
     'def2': 90,
     'fwd0': 1,
     'fwd1': 30,
     'gk1': 90,
     'gk2': 1,
     'mid0': 30,
     'mid1': 30,
     'mid2': 30,
     'mid3': 1,
     'mid4': 30},
    {'b0': 'MID',
     'b1': 'FWD',
     'b2': 'FWD',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID',
     'mid4': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0', 'fwd1']),
  ('normal control 2',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 90,
     'b1': 30,
     'b2': 0,
     'def0': 30,
     'def1': 90,
     'def2': 90,
     'fwd0': 1,
     'fwd1': 1,
     'fwd2': 90,
     'gk1': 90,
     'gk2': 30,
     'mid0': 1,
     'mid1': 0,
     'mid2': 1,
     'mid3': 90},
    {'b0': 'MID',
     'b1': 'FWD',
     'b2': 'DEF',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'fwd2': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'mid0', 'b0', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2']),
  ('normal control 3',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 0,
     'b1': 0,
     'b2': 1,
     'def0': 1,
     'def1': 1,
     'def2': 0,
     'fwd0': 1,
     'fwd1': 0,
     'fwd2': 90,
     'gk1': 90,
     'gk2': 0,
     'mid0': 30,
     'mid1': 1,
     'mid2': 1,
     'mid3': 30},
    {'b0': 'DEF',
     'b1': 'FWD',
     'b2': 'FWD',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'fwd2': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'b2', 'fwd2']),
  ('normal control 4',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 1,
     'b1': 90,
     'b2': 90,
     'def0': 90,
     'def1': 1,
     'def2': 30,
     'fwd0': 90,
     'fwd1': 1,
     'fwd2': 30,
     'gk1': 30,
     'gk2': 1,
     'mid0': 1,
     'mid1': 90,
     'mid2': 30,
     'mid3': 1},
    {'b0': 'FWD',
     'b1': 'DEF',
     'b2': 'FWD',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'fwd2': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2'])],
 [('regression: used bench tracking',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 0,
     'b1': 1,
     'b2': 30,
     'def0': 30,
     'def1': 0,
     'def2': 90,
     'def3': 30,
     'fwd0': 1,
     'gk1': 30,
     'gk2': 90,
     'mid0': 30,
     'mid1': 0,
     'mid2': 1,
     'mid3': 0,
     'mid4': 1},
    {'b0': 'DEF',
     'b1': 'MID',
     'b2': 'DEF',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'fwd0': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID',
     'mid4': 'MID'}],
   ['gk1', 'def0', 'b1', 'def2', 'def3', 'mid0', 'b2', 'mid2', 'mid3', 'mid4', 'fwd0']),
  ('partial repair probe: used bench tracking',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'def4', 'mid0', 'mid1', 'mid2', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 1,
     'b1': 90,
     'b2': 1,
     'def0': 30,
     'def1': 1,
     'def2': 1,
     'def3': 0,
     'def4': 0,
     'fwd0': 90,
     'fwd1': 90,
     'gk1': 1,
     'gk2': 30,
     'mid0': 1,
     'mid1': 0,
     'mid2': 0},
    {'b0': 'DEF',
     'b1': 'MID',
     'b2': 'FWD',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'def4': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'b0', 'b1', 'mid0', 'b2', 'mid2', 'fwd0', 'fwd1']),
  ('second regression',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 30,
     'b1': 30,
     'b2': 0,
     'def0': 90,
     'def1': 30,
     'def2': 0,
     'fwd0': 90,
     'fwd1': 90,
     'gk1': 0,
     'gk2': 90,
     'mid0': 1,
     'mid1': 90,
     'mid2': 0,
     'mid3': 0,
     'mid4': 1},
    {'b0': 'MID',
     'b1': 'DEF',
     'b2': 'FWD',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID',
     'mid4': 'MID'}],
   ['gk2', 'def0', 'def1', 'b1', 'mid0', 'mid1', 'b0', 'mid3', 'mid4', 'fwd0', 'fwd1']),
  ('normal control 1',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 30,
     'b1': 0,
     'b2': 30,
     'def0': 90,
     'def1': 30,
     'def2': 90,
     'fwd0': 1,
     'fwd1': 90,
     'fwd2': 30,
     'gk1': 90,
     'gk2': 90,
     'mid0': 90,
     'mid1': 90,
     'mid2': 1,
     'mid3': 30},
    {'b0': 'DEF',
     'b1': 'FWD',
     'b2': 'FWD',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'fwd2': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2']),
  ('normal control 2',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'def4', 'mid0', 'mid1', 'mid2', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 30,
     'b1': 0,
     'b2': 90,
     'def0': 1,
     'def1': 1,
     'def2': 30,
     'def3': 30,
     'def4': 0,
     'fwd0': 1,
     'fwd1': 30,
     'gk1': 90,
     'gk2': 1,
     'mid0': 30,
     'mid1': 1,
     'mid2': 1},
    {'b0': 'DEF',
     'b1': 'DEF',
     'b2': 'FWD',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'def4': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'def3', 'b0', 'mid0', 'mid1', 'mid2', 'fwd0', 'fwd1']),
  ('normal control 3',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 90,
     'b1': 1,
     'b2': 90,
     'def0': 0,
     'def1': 90,
     'def2': 90,
     'def3': 90,
     'fwd0': 30,
     'fwd1': 30,
     'gk1': 90,
     'gk2': 0,
     'mid0': 1,
     'mid1': 90,
     'mid2': 30,
     'mid3': 1},
    {'b0': 'DEF',
     'b1': 'MID',
     'b2': 'MID',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk1', 'b0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1']),
  ('normal control 4',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 0,
     'b1': 90,
     'b2': 30,
     'def0': 1,
     'def1': 30,
     'def2': 1,
     'def3': 1,
     'fwd0': 1,
     'fwd1': 30,
     'gk1': 0,
     'gk2': 1,
     'mid0': 90,
     'mid1': 30,
     'mid2': 0,
     'mid3': 30},
    {'b0': 'FWD',
     'b1': 'DEF',
     'b2': 'DEF',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk2', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'b1', 'mid3', 'fwd0', 'fwd1'])],
 [('regression: used bench tracking',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 90,
     'b1': 1,
     'b2': 1,
     'def0': 30,
     'def1': 90,
     'def2': 0,
     'fwd0': 1,
     'fwd1': 30,
     'fwd2': 1,
     'gk1': 1,
     'gk2': 90,
     'mid0': 30,
     'mid1': 0,
     'mid2': 90,
     'mid3': 1},
    {'b0': 'DEF',
     'b1': 'DEF',
     'b2': 'MID',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'fwd2': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk1', 'def0', 'def1', 'b0', 'mid0', 'b1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2']),
  ('partial repair probe: used bench tracking',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'def4', 'mid0', 'mid1', 'mid2', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 1,
     'b1': 1,
     'b2': 30,
     'def0': 90,
     'def1': 0,
     'def2': 90,
     'def3': 90,
     'def4': 1,
     'fwd0': 0,
     'fwd1': 90,
     'gk1': 1,
     'gk2': 90,
     'mid0': 90,
     'mid1': 90,
     'mid2': 1},
    {'b0': 'DEF',
     'b1': 'FWD',
     'b2': 'FWD',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'def4': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID'}],
   ['gk1', 'def0', 'b0', 'def2', 'def3', 'def4', 'mid0', 'mid1', 'mid2', 'b1', 'fwd1']),
  ('second regression',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 0,
     'b1': 1,
     'b2': 0,
     'def0': 90,
     'def1': 90,
     'def2': 90,
     'fwd0': 0,
     'fwd1': 1,
     'fwd2': 0,
     'gk1': 1,
     'gk2': 1,
     'mid0': 1,
     'mid1': 1,
     'mid2': 1,
     'mid3': 1},
    {'b0': 'MID',
     'b1': 'MID',
     'b2': 'FWD',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'fwd2': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'b1', 'fwd1', 'fwd2']),
  ('normal control 1',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 90,
     'b1': 0,
     'b2': 1,
     'def0': 0,
     'def1': 30,
     'def2': 30,
     'def3': 1,
     'fwd0': 30,
     'gk1': 1,
     'gk2': 90,
     'mid0': 90,
     'mid1': 30,
     'mid2': 90,
     'mid3': 1,
     'mid4': 90},
    {'b0': 'DEF',
     'b1': 'FWD',
     'b2': 'DEF',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'fwd0': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID',
     'mid4': 'MID'}],
   ['gk1', 'b0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0']),
  ('normal control 2',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 1,
     'b1': 90,
     'b2': 1,
     'def0': 0,
     'def1': 90,
     'def2': 1,
     'fwd0': 30,
     'fwd1': 90,
     'fwd2': 90,
     'gk1': 1,
     'gk2': 1,
     'mid0': 30,
     'mid1': 1,
     'mid2': 1,
     'mid3': 30},
    {'b0': 'FWD',
     'b1': 'FWD',
     'b2': 'MID',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'fwd2': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'fwd0', 'fwd1', 'fwd2']),
  ('normal control 3',
   [['gk1', 'def0', 'def1', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 30,
     'b1': 0,
     'b2': 1,
     'def0': 30,
     'def1': 0,
     'def2': 1,
     'def3': 30,
     'fwd0': 90,
     'gk1': 90,
     'gk2': 90,
     'mid0': 30,
     'mid1': 30,
     'mid2': 30,
     'mid3': 1,
     'mid4': 30},
    {'b0': 'MID',
     'b1': 'FWD',
     'b2': 'FWD',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'def3': 'DEF',
     'fwd0': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID',
     'mid4': 'MID'}],
   ['gk1', 'def0', 'b0', 'def2', 'def3', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0']),
  ('normal control 4',
   [['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0', 'fwd1'],
    ['gk2', 'b0', 'b1', 'b2'],
    {'b0': 1,
     'b1': 0,
     'b2': 1,
     'def0': 90,
     'def1': 1,
     'def2': 30,
     'fwd0': 90,
     'fwd1': 0,
     'gk1': 1,
     'gk2': 1,
     'mid0': 30,
     'mid1': 90,
     'mid2': 90,
     'mid3': 1,
     'mid4': 90},
    {'b0': 'DEF',
     'b1': 'MID',
     'b2': 'FWD',
     'def0': 'DEF',
     'def1': 'DEF',
     'def2': 'DEF',
     'fwd0': 'FWD',
     'fwd1': 'FWD',
     'gk1': 'GK',
     'gk2': 'GK',
     'mid0': 'MID',
     'mid1': 'MID',
     'mid2': 'MID',
     'mid3': 'MID',
     'mid4': 'MID'}],
   ['gk1', 'def0', 'def1', 'def2', 'mid0', 'mid1', 'mid2', 'mid3', 'mid4', 'fwd0', 'b0'])]]
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 same bench midfielder appears twice in the final XI.

Starters who played 0 minutes are replaced in starter order. A goalkeeper can only be replaced by the bench goalkeeper (bench[0]) and only if he played. An outfield starter is replaced by the first outfield bench player in bench order who played and is not already used, provided the XI with the candidate in place keeps at least 3 DEF, 2 MID and 1 FWD. Return the final XI in starter-slot order.

split: open-access


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

N = 1
observations = []
def solve(bps):
    ordered = sorted(bps.items(), key=lambda kv: (-kv[1], kv[0]))
    award = [3, 2, 1]
    out = {}
    pos = 0
    i = 0
    while i < len(ordered) and pos < 3:
        j = i
        while j < len(ordered) and ordered[j][1] == ordered[i][1]:
            j += 1
        for name, v in ordered[i:j]:
            if v > 0:
                out[name] = award[pos]
        pos += 1
        i = j
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: position consumption', [{'bo': 34, 'ce': 12, 'ek': 4, 'fu': 34}],
   {'bo': 3, 'ce': 1, 'fu': 3}),
  ('partial repair probe: position consumption',
   [{'ax': 30, 'bo': -2, 'ce': 27, 'di': 32, 'ek': 27, 'fu': 12, 'gi': 34, 'ho': 30}],
   {'ax': 1, 'di': 2, 'gi': 3, 'ho': 1}),
  ('second regression', [{'ax': 0, 'ce': 34, 'di': -2, 'ek': 5, 'fu': 12, 'gi': 27}],
   {'ce': 3, 'fu': 1, 'gi': 2}),
  ('normal control 1', [{'bo': 30, 'ek': 30, 'fu': 34, 'gi': 0, 'ho': -2}], {'bo': 2, 'ek': 2, 'fu': 3}),
  ('normal control 2', [{'ce': 0, 'di': 30, 'ek': 34}], {'di': 2, 'ek': 3}),
  ('normal control 3', [{'ce': 30, 'di': -2, 'fu': -2, 'gi': 0}], {'ce': 3}),
  ('normal control 4', [{'ax': 30, 'bo': -2, 'ce': 30, 'ek': 30}], {'ax': 3, 'ce': 3, 'ek': 3})],
 [('regression: position consumption', [{'ax': 34, 'bo': 30, 'fu': -2, 'gi': 34, 'ho': 0}],
   {'ax': 3, 'bo': 1, 'gi': 3}),
  ('partial repair probe: position consumption', [{'bo': 34, 'ce': 34, 'ek': 30, 'fu': 26}],
   {'bo': 3, 'ce': 3, 'ek': 1}),
  ('second regression', [{'ax': 34, 'ce': 7, 'di': 0, 'gi': 34}], {'ax': 3, 'ce': 1, 'gi': 3}),
  ('normal control 1', [{'ce': 0, 'gi': -2, 'ho': -2}], {}),
  ('normal control 2', [{'ce': 12, 'ek': -2, 'fu': 29, 'ho': 12}], {'ce': 2, 'fu': 3, 'ho': 2}),
  ('normal control 3', [{'ce': -2, 'ek': 34, 'fu': 12}], {'ek': 3, 'fu': 2}),
  ('normal control 4', [{'ce': 34, 'di': -2, 'gi': 30}], {'ce': 3, 'gi': 2})],
 [('regression: position consumption', [{'ax': 34, 'bo': 12, 'ce': 34, 'di': 34, 'fu': 0, 'gi': 30, 'ho': 0}],
   {'ax': 3, 'ce': 3, 'di': 3}),
  ('partial repair probe: position consumption', [{'bo': 0, 'ce': 17, 'fu': 30, 'ho': 34}],
   {'ce': 1, 'fu': 2, 'ho': 3}),
  ('second regression', [{'ax': 34, 'ek': 28, 'gi': 30}], {'ax': 3, 'ek': 1, 'gi': 2}),
  ('normal control 1', [{'ce': 34, 'di': 0, 'ek': 34}], {'ce': 3, 'ek': 3}),
  ('normal control 2', [{'bo': -2, 'di': -2, 'fu': 24}], {'fu': 3}),
  ('normal control 3', [{'ax': 0, 'di': 0, 'fu': 30, 'ho': 12}], {'fu': 3, 'ho': 2}),
  ('normal control 4', [{'ax': 34, 'bo': -2, 'ce': -2, 'ek': 0, 'fu': 12, 'gi': 0, 'ho': -2}],
   {'ax': 3, 'fu': 2})],
 [('regression: position consumption',
   [{'ax': 12, 'bo': 34, 'ce': 34, 'di': 0, 'ek': 0, 'fu': 12, 'gi': 34, 'ho': 27}],
   {'bo': 3, 'ce': 3, 'gi': 3}),
  ('partial repair probe: position consumption', [{'ax': 12, 'ce': 30, 'ek': 27, 'ho': -2}],
   {'ax': 1, 'ce': 3, 'ek': 2}),
  ('second regression', [{'ax': 27, 'bo': 0, 'ce': 34, 'di': 0, 'ek': 0, 'fu': 27, 'gi': 30, 'ho': 0}],
   {'ax': 1, 'ce': 3, 'fu': 1, 'gi': 2}),
  ('normal control 1', [{'bo': 12, 'di': 34, 'fu': 0}], {'bo': 2, 'di': 3}),
  ('normal control 2', [{'ax': 0, 'ce': 0, 'fu': -2}], {}),
  ('normal control 3', [{'ax': 30, 'ek': 30, 'gi': 34}], {'ax': 2, 'ek': 2, 'gi': 3}),
  ('normal control 4', [{'ce': -2, 'di': 0, 'fu': 34, 'ho': 34}], {'fu': 3, 'ho': 3})],
 [('regression: position consumption',
   [{'ax': 12, 'bo': 34, 'ce': 0, 'di': 34, 'fu': 30, 'gi': 34, 'ho': 30}], {'bo': 3, 'di': 3, 'gi': 3}),
  ('partial repair probe: position consumption',
   [{'ax': 30, 'bo': 0, 'ce': 0, 'ek': 27, 'fu': 27, 'gi': 12, 'ho': 34}],
   {'ax': 2, 'ek': 1, 'fu': 1, 'ho': 3}),
  ('second regression', [{'ax': 27, 'ce': 8, 'di': 0, 'fu': 30, 'gi': -2}], {'ax': 2, 'ce': 1, 'fu': 3}),
  ('normal control 1', [{'bo': 34, 'di': 27, 'ek': -2}], {'bo': 3, 'di': 2}),
  ('normal control 2', [{'ax': 30, 'bo': 12, 'ce': 0, 'fu': 12, 'ho': 12}],
   {'ax': 3, 'bo': 2, 'fu': 2, 'ho': 2}),
  ('normal control 3', [{'ax': -2, 'ce': -2, 'di': -2, 'ek': -2}], {}),
  ('normal control 4', [{'bo': -2, 'gi': 0, 'ho': 12}], {'ho': 3})]]
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(bps):
    ordered = sorted(bps.items(), key=lambda kv: (-kv[1], kv[0]))
    award = [3, 2, 1]
    out = {}
    pos = 0
    i = 0
    while i < len(ordered) and pos < 3:
        j = i
        while j < len(ordered) and ordered[j][1] == ordered[i][1]:
            j += 1
        for name, v in ordered[i:j]:
            if v > 0:
                out[name] = award[pos]
        pos = j - i
        i = j
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: position consumption', [{'bo': 34, 'ce': 12, 'ek': 4, 'fu': 34}],
   {'bo': 3, 'ce': 1, 'fu': 3}),
  ('partial repair probe: position consumption',
   [{'ax': 30, 'bo': -2, 'ce': 27, 'di': 32, 'ek': 27, 'fu': 12, 'gi': 34, 'ho': 30}],
   {'ax': 1, 'di': 2, 'gi': 3, 'ho': 1}),
  ('second regression', [{'ax': 0, 'ce': 34, 'di': -2, 'ek': 5, 'fu': 12, 'gi': 27}],
   {'ce': 3, 'fu': 1, 'gi': 2}),
  ('normal control 1', [{'bo': 30, 'ek': 30, 'fu': 34, 'gi': 0, 'ho': -2}], {'bo': 2, 'ek': 2, 'fu': 3}),
  ('normal control 2', [{'ce': 0, 'di': 30, 'ek': 34}], {'di': 2, 'ek': 3}),
  ('normal control 3', [{'ce': 30, 'di': -2, 'fu': -2, 'gi': 0}], {'ce': 3}),
  ('normal control 4', [{'ax': 30, 'bo': -2, 'ce': 30, 'ek': 30}], {'ax': 3, 'ce': 3, 'ek': 3})],
 [('regression: position consumption', [{'ax': 34, 'bo': 30, 'fu': -2, 'gi': 34, 'ho': 0}],
   {'ax': 3, 'bo': 1, 'gi': 3}),
  ('partial repair probe: position consumption', [{'bo': 34, 'ce': 34, 'ek': 30, 'fu': 26}],
   {'bo': 3, 'ce': 3, 'ek': 1}),
  ('second regression', [{'ax': 34, 'ce': 7, 'di': 0, 'gi': 34}], {'ax': 3, 'ce': 1, 'gi': 3}),
  ('normal control 1', [{'ce': 0, 'gi': -2, 'ho': -2}], {}),
  ('normal control 2', [{'ce': 12, 'ek': -2, 'fu': 29, 'ho': 12}], {'ce': 2, 'fu': 3, 'ho': 2}),
  ('normal control 3', [{'ce': -2, 'ek': 34, 'fu': 12}], {'ek': 3, 'fu': 2}),
  ('normal control 4', [{'ce': 34, 'di': -2, 'gi': 30}], {'ce': 3, 'gi': 2})],
 [('regression: position consumption', [{'ax': 34, 'bo': 12, 'ce': 34, 'di': 34, 'fu': 0, 'gi': 30, 'ho': 0}],
   {'ax': 3, 'ce': 3, 'di': 3}),
  ('partial repair probe: position consumption', [{'bo': 0, 'ce': 17, 'fu': 30, 'ho': 34}],
   {'ce': 1, 'fu': 2, 'ho': 3}),
  ('second regression', [{'ax': 34, 'ek': 28, 'gi': 30}], {'ax': 3, 'ek': 1, 'gi': 2}),
  ('normal control 1', [{'ce': 34, 'di': 0, 'ek': 34}], {'ce': 3, 'ek': 3}),
  ('normal control 2', [{'bo': -2, 'di': -2, 'fu': 24}], {'fu': 3}),
  ('normal control 3', [{'ax': 0, 'di': 0, 'fu': 30, 'ho': 12}], {'fu': 3, 'ho': 2}),
  ('normal control 4', [{'ax': 34, 'bo': -2, 'ce': -2, 'ek': 0, 'fu': 12, 'gi': 0, 'ho': -2}],
   {'ax': 3, 'fu': 2})],
 [('regression: position consumption',
   [{'ax': 12, 'bo': 34, 'ce': 34, 'di': 0, 'ek': 0, 'fu': 12, 'gi': 34, 'ho': 27}],
   {'bo': 3, 'ce': 3, 'gi': 3}),
  ('partial repair probe: position consumption', [{'ax': 12, 'ce': 30, 'ek': 27, 'ho': -2}],
   {'ax': 1, 'ce': 3, 'ek': 2}),
  ('second regression', [{'ax': 27, 'bo': 0, 'ce': 34, 'di': 0, 'ek': 0, 'fu': 27, 'gi': 30, 'ho': 0}],
   {'ax': 1, 'ce': 3, 'fu': 1, 'gi': 2}),
  ('normal control 1', [{'bo': 12, 'di': 34, 'fu': 0}], {'bo': 2, 'di': 3}),
  ('normal control 2', [{'ax': 0, 'ce': 0, 'fu': -2}], {}),
  ('normal control 3', [{'ax': 30, 'ek': 30, 'gi': 34}], {'ax': 2, 'ek': 2, 'gi': 3}),
  ('normal control 4', [{'ce': -2, 'di': 0, 'fu': 34, 'ho': 34}], {'fu': 3, 'ho': 3})],
 [('regression: position consumption',
   [{'ax': 12, 'bo': 34, 'ce': 0, 'di': 34, 'fu': 30, 'gi': 34, 'ho': 30}], {'bo': 3, 'di': 3, 'gi': 3}),
  ('partial repair probe: position consumption',
   [{'ax': 30, 'bo': 0, 'ce': 0, 'ek': 27, 'fu': 27, 'gi': 12, 'ho': 34}],
   {'ax': 2, 'ek': 1, 'fu': 1, 'ho': 3}),
  ('second regression', [{'ax': 27, 'ce': 8, 'di': 0, 'fu': 30, 'gi': -2}], {'ax': 2, 'ce': 1, 'fu': 3}),
  ('normal control 1', [{'bo': 34, 'di': 27, 'ek': -2}], {'bo': 3, 'di': 2}),
  ('normal control 2', [{'ax': 30, 'bo': 12, 'ce': 0, 'fu': 12, 'ho': 12}],
   {'ax': 3, 'bo': 2, 'fu': 2, 'ho': 2}),
  ('normal control 3', [{'ax': -2, 'ce': -2, 'di': -2, 'ek': -2}], {}),
  ('normal control 4', [{'bo': -2, 'gi': 0, 'ho': 12}], {'ho': 3})]]
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:
After a two-way tie for first, the next player still receives 2 bonus.

Allocate bonus points from a per-match performance index: rank players by index descending; positions 1, 2, 3 earn 3, 2, 1. Tied players all receive the award of the first position their group occupies and consume as many positions as the group size, so a two-way tie for first earns 3 each and the next player 1. Players whose index is 0 or below never receive bonus. Return name -> bonus for awarded players.

split: open-access


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

N = 1
observations = []
def solve(bps):
    ordered = sorted(bps.items(), key=lambda kv: (-kv[1], kv[0]))
    award = [3, 2, 1]
    out = {}
    pos = 0
    i = 0
    while i < len(ordered) and pos < 3:
        j = i
        while j < len(ordered) and ordered[j][1] == ordered[i][1]:
            j += 1
        for name, v in ordered[i:j]:
            if v is not None:
                out[name] = award[pos]
        pos += j - i
        i = j
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: non-positive index', [{'ax': 0, 'bo': -2, 'ce': 30, 'gi': 12}], {'ce': 3, 'gi': 2}),
  ('partial repair probe: non-positive index', [{'bo': 12, 'di': 0, 'fu': 30}], {'bo': 2, 'fu': 3}),
  ('second regression', [{'ax': 19, 'gi': 30, 'ho': 0}], {'ax': 2, 'gi': 3}),
  ('normal control 1', [{'ce': 12, 'di': 2, 'fu': 34, 'gi': 0, 'ho': 34}], {'ce': 1, 'fu': 3, 'ho': 3}),
  ('normal control 2', [{'ce': 30, 'ek': 12, 'fu': 0, 'gi': 38}], {'ce': 2, 'ek': 1, 'gi': 3}),
  ('normal control 3', [{'bo': 34, 'ce': 0, 'di': 30, 'ek': 22, 'ho': 0}], {'bo': 3, 'di': 2, 'ek': 1}),
  ('normal control 4', [{'ax': 24, 'bo': -2, 'ce': 34, 'ek': 30, 'fu': 34, 'gi': 34, 'ho': -2}],
   {'ce': 3, 'fu': 3, 'gi': 3})],
 [('regression: non-positive index', [{'di': 0, 'ek': -2, 'gi': 27}], {'gi': 3}),
  ('partial repair probe: non-positive index', [{'bo': 27, 'di': 0, 'fu': 0}], {'bo': 3}),
  ('second regression', [{'bo': 34, 'ce': 0, 'di': 30, 'gi': -2, 'ho': 0}], {'bo': 3, 'di': 2}),
  ('normal control 1', [{'bo': 34, 'fu': 30, 'ho': 30}], {'bo': 3, 'fu': 2, 'ho': 2}),
  ('normal control 2', [{'bo': 30, 'di': 30, 'fu': 12, 'gi': 13, 'ho': 12}], {'bo': 3, 'di': 3, 'gi': 1}),
  ('normal control 3', [{'bo': 10, 'ce': 34, 'di': 30, 'ek': -2, 'fu': 34, 'gi': 34, 'ho': -2}],
   {'ce': 3, 'fu': 3, 'gi': 3}),
  ('normal control 4', [{'bo': 4, 'ce': 27, 'di': 12, 'gi': 34}], {'ce': 2, 'di': 1, 'gi': 3})],
 [('regression: non-positive index', [{'ax': 12, 'ek': 27, 'ho': -2}], {'ax': 2, 'ek': 3}),
  ('partial repair probe: non-positive index', [{'bo': 12, 'fu': 0, 'ho': 27}], {'bo': 2, 'ho': 3}),
  ('second regression', [{'ax': 30, 'ek': -2, 'gi': 6}], {'ax': 3, 'gi': 2}),
  ('normal control 1', [{'ax': 34, 'bo': 30, 'ce': -2, 'di': 30, 'ek': -2, 'fu': 34, 'gi': 34, 'ho': 34}],
   {'ax': 3, 'fu': 3, 'gi': 3, 'ho': 3}),
  ('normal control 2', [{'ax': 30, 'bo': 30, 'ce': 34, 'ek': 12, 'ho': 30}],
   {'ax': 2, 'bo': 2, 'ce': 3, 'ho': 2}),
  ('normal control 3', [{'ax': 27, 'di': 30, 'fu': 32, 'gi': 30}], {'di': 2, 'fu': 3, 'gi': 2}),
  ('normal control 4', [{'ax': 0, 'bo': -2, 'ce': 0, 'di': 27, 'ek': 12, 'fu': 30, 'gi': 1}],
   {'di': 2, 'ek': 1, 'fu': 3})],
 [('regression: non-positive index', [{'bo': -1, 'di': 34, 'ho': 0}], {'di': 3}),
  ('partial repair probe: non-positive index', [{'bo': 0, 'ce': 34, 'fu': 34}], {'ce': 3, 'fu': 3}),
  ('second regression', [{'ax': -2, 'bo': 0, 'di': 30, 'ek': 34, 'fu': 0, 'ho': 0}], {'di': 2, 'ek': 3}),
  ('normal control 1', [{'ax': 30, 'ce': 30, 'di': 30, 'fu': 34, 'gi': 27}],
   {'ax': 2, 'ce': 2, 'di': 2, 'fu': 3}),
  ('normal control 2', [{'ax': 30, 'ce': 30, 'di': 30, 'ek': 34, 'fu': 27, 'gi': 18, 'ho': 27}],
   {'ax': 2, 'ce': 2, 'di': 2, 'ek': 3}),
  ('normal control 3', [{'ax': 34, 'ce': 0, 'ek': 30, 'ho': 12}], {'ax': 3, 'ek': 2, 'ho': 1}),
  ('normal control 4', [{'ax': 30, 'ce': 30, 'di': 12, 'ek': 30, 'gi': 34, 'ho': 34}],
   {'ax': 1, 'ce': 1, 'ek': 1, 'gi': 3, 'ho': 3})],
 [('regression: non-positive index', [{'bo': 0, 'fu': 6, 'gi': 30}], {'fu': 2, 'gi': 3}),
  ('partial repair probe: non-positive index', [{'ce': 0, 'di': 30, 'fu': 0, 'gi': 30, 'ho': -2}],
   {'di': 3, 'gi': 3}),
  ('second regression', [{'fu': 30, 'gi': 0, 'ho': 34}], {'fu': 2, 'ho': 3}),
  ('normal control 1', [{'ax': 27, 'bo': 34, 'ek': 30, 'fu': 27, 'gi': 40, 'ho': 30}],
   {'bo': 2, 'ek': 1, 'gi': 3, 'ho': 1}),
  ('normal control 2', [{'ax': 34, 'ce': 30, 'fu': -2, 'gi': 30, 'ho': 34}],
   {'ax': 3, 'ce': 1, 'gi': 1, 'ho': 3}),
  ('normal control 3', [{'ek': 34, 'fu': 30, 'gi': 34, 'ho': 27}], {'ek': 3, 'fu': 1, 'gi': 3}),
  ('normal control 4', [{'ax': 30, 'bo': 16, 'ce': 34, 'di': 12, 'gi': 34, 'ho': 26}],
   {'ax': 1, 'ce': 3, 'gi': 3})]]
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(bps):
    ordered = sorted(bps.items(), key=lambda kv: (-kv[1], kv[0]))
    award = [3, 2, 1]
    out = {}
    pos = 0
    i = 0
    while i < len(ordered) and pos < 3:
        j = i
        while j < len(ordered) and ordered[j][1] == ordered[i][1]:
            j += 1
        for name, v in ordered[i:j]:
            if v >= 0:
                out[name] = award[pos]
        pos += j - i
        i = j
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: non-positive index', [{'ax': 0, 'bo': -2, 'ce': 30, 'gi': 12}], {'ce': 3, 'gi': 2}),
  ('partial repair probe: non-positive index', [{'bo': 12, 'di': 0, 'fu': 30}], {'bo': 2, 'fu': 3}),
  ('second regression', [{'ax': 19, 'gi': 30, 'ho': 0}], {'ax': 2, 'gi': 3}),
  ('normal control 1', [{'ce': 12, 'di': 2, 'fu': 34, 'gi': 0, 'ho': 34}], {'ce': 1, 'fu': 3, 'ho': 3}),
  ('normal control 2', [{'ce': 30, 'ek': 12, 'fu': 0, 'gi': 38}], {'ce': 2, 'ek': 1, 'gi': 3}),
  ('normal control 3', [{'bo': 34, 'ce': 0, 'di': 30, 'ek': 22, 'ho': 0}], {'bo': 3, 'di': 2, 'ek': 1}),
  ('normal control 4', [{'ax': 24, 'bo': -2, 'ce': 34, 'ek': 30, 'fu': 34, 'gi': 34, 'ho': -2}],
   {'ce': 3, 'fu': 3, 'gi': 3})],
 [('regression: non-positive index', [{'di': 0, 'ek': -2, 'gi': 27}], {'gi': 3}),
  ('partial repair probe: non-positive index', [{'bo': 27, 'di': 0, 'fu': 0}], {'bo': 3}),
  ('second regression', [{'bo': 34, 'ce': 0, 'di': 30, 'gi': -2, 'ho': 0}], {'bo': 3, 'di': 2}),
  ('normal control 1', [{'bo': 34, 'fu': 30, 'ho': 30}], {'bo': 3, 'fu': 2, 'ho': 2}),
  ('normal control 2', [{'bo': 30, 'di': 30, 'fu': 12, 'gi': 13, 'ho': 12}], {'bo': 3, 'di': 3, 'gi': 1}),
  ('normal control 3', [{'bo': 10, 'ce': 34, 'di': 30, 'ek': -2, 'fu': 34, 'gi': 34, 'ho': -2}],
   {'ce': 3, 'fu': 3, 'gi': 3}),
  ('normal control 4', [{'bo': 4, 'ce': 27, 'di': 12, 'gi': 34}], {'ce': 2, 'di': 1, 'gi': 3})],
 [('regression: non-positive index', [{'ax': 12, 'ek': 27, 'ho': -2}], {'ax': 2, 'ek': 3}),
  ('partial repair probe: non-positive index', [{'bo': 12, 'fu': 0, 'ho': 27}], {'bo': 2, 'ho': 3}),
  ('second regression', [{'ax': 30, 'ek': -2, 'gi': 6}], {'ax': 3, 'gi': 2}),
  ('normal control 1', [{'ax': 34, 'bo': 30, 'ce': -2, 'di': 30, 'ek': -2, 'fu': 34, 'gi': 34, 'ho': 34}],
   {'ax': 3, 'fu': 3, 'gi': 3, 'ho': 3}),
  ('normal control 2', [{'ax': 30, 'bo': 30, 'ce': 34, 'ek': 12, 'ho': 30}],
   {'ax': 2, 'bo': 2, 'ce': 3, 'ho': 2}),
  ('normal control 3', [{'ax': 27, 'di': 30, 'fu': 32, 'gi': 30}], {'di': 2, 'fu': 3, 'gi': 2}),
  ('normal control 4', [{'ax': 0, 'bo': -2, 'ce': 0, 'di': 27, 'ek': 12, 'fu': 30, 'gi': 1}],
   {'di': 2, 'ek': 1, 'fu': 3})],
 [('regression: non-positive index', [{'bo': -1, 'di': 34, 'ho': 0}], {'di': 3}),
  ('partial repair probe: non-positive index', [{'bo': 0, 'ce': 34, 'fu': 34}], {'ce': 3, 'fu': 3}),
  ('second regression', [{'ax': -2, 'bo': 0, 'di': 30, 'ek': 34, 'fu': 0, 'ho': 0}], {'di': 2, 'ek': 3}),
  ('normal control 1', [{'ax': 30, 'ce': 30, 'di': 30, 'fu': 34, 'gi': 27}],
   {'ax': 2, 'ce': 2, 'di': 2, 'fu': 3}),
  ('normal control 2', [{'ax': 30, 'ce': 30, 'di': 30, 'ek': 34, 'fu': 27, 'gi': 18, 'ho': 27}],
   {'ax': 2, 'ce': 2, 'di': 2, 'ek': 3}),
  ('normal control 3', [{'ax': 34, 'ce': 0, 'ek': 30, 'ho': 12}], {'ax': 3, 'ek': 2, 'ho': 1}),
  ('normal control 4', [{'ax': 30, 'ce': 30, 'di': 12, 'ek': 30, 'gi': 34, 'ho': 34}],
   {'ax': 1, 'ce': 1, 'ek': 1, 'gi': 3, 'ho': 3})],
 [('regression: non-positive index', [{'bo': 0, 'fu': 6, 'gi': 30}], {'fu': 2, 'gi': 3}),
  ('partial repair probe: non-positive index', [{'ce': 0, 'di': 30, 'fu': 0, 'gi': 30, 'ho': -2}],
   {'di': 3, 'gi': 3}),
  ('second regression', [{'fu': 30, 'gi': 0, 'ho': 34}], {'fu': 2, 'ho': 3}),
  ('normal control 1', [{'ax': 27, 'bo': 34, 'ek': 30, 'fu': 27, 'gi': 40, 'ho': 30}],
   {'bo': 2, 'ek': 1, 'gi': 3, 'ho': 1}),
  ('normal control 2', [{'ax': 34, 'ce': 30, 'fu': -2, 'gi': 30, 'ho': 34}],
   {'ax': 3, 'ce': 1, 'gi': 1, 'ho': 3}),
  ('normal control 3', [{'ek': 34, 'fu': 30, 'gi': 34, 'ho': 27}], {'ek': 3, 'fu': 1, 'gi': 3}),
  ('normal control 4', [{'ax': 30, 'bo': 16, 'ce': 34, 'di': 12, 'gi': 34, 'ho': 26}],
   {'ax': 1, 'ce': 3, 'gi': 3})]]
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:
In a low-scoring match a player with index 0 is awarded 1 bonus.

Allocate bonus points from a per-match performance index: rank players by index descending; positions 1, 2, 3 earn 3, 2, 1. Tied players all receive the award of the first position their group occupies and consume as many positions as the group size, so a two-way tie for first earns 3 each and the next player 1. Players whose index is 0 or below never receive bonus. Return name -> bonus for awarded players.

split: open-access


prompt:
Two players tied on the top index receive 3 and 2.

Allocate bonus points from a per-match performance index: rank players by index descending; positions 1, 2, 3 earn 3, 2, 1. Tied players all receive the award of the first position their group occupies and consume as many positions as the group size, so a two-way tie for first earns 3 each and the next player 1. Players whose index is 0 or below never receive bonus. Return name -> bonus for awarded players.

split: open-access


prompt:
Five straight birdies earn three streak bonuses.

Score a golf round given [par, strokes] per hole, in tenths: albatross or better 13, eagle 8, birdie 3, par 0.5, bogey -0.5, double bogey or worse -1; any hole-in-one earns +5 on top. Each maximal run of three or more consecutive birdie-or-better holes earns one 3 point streak bonus. A complete 18-hole round with no bogey or worse earns +3; a complete 18-hole round under 70 strokes earns +5.

split: open-access


prompt:
Birdie, par, birdie, birdie counts as a three-hole streak.

Score a golf round given [par, strokes] per hole, in tenths: albatross or better 13, eagle 8, birdie 3, par 0.5, bogey -0.5, double bogey or worse -1; any hole-in-one earns +5 on top. Each maximal run of three or more consecutive birdie-or-better holes earns one 3 point streak bonus. A complete 18-hole round with no bogey or worse earns +3; a complete 18-hole round under 70 strokes earns +5.

split: open-access


prompt:
An ace on a short par four earns no hole-in-one bonus.

Score a golf round given [par, strokes] per hole, in tenths: albatross or better 13, eagle 8, birdie 3, par 0.5, bogey -0.5, double bogey or worse -1; any hole-in-one earns +5 on top. Each maximal run of three or more consecutive birdie-or-better holes earns one 3 point streak bonus. A complete 18-hole round with no bogey or worse earns +3; a complete 18-hole round under 70 strokes earns +5.

split: open-access


prompt:
A golfer who withdrew after nine clean holes earns the bogey-free bonus.

Score a golf round given [par, strokes] per hole, in tenths: albatross or better 13, eagle 8, birdie 3, par 0.5, bogey -0.5, double bogey or worse -1; any hole-in-one earns +5 on top. Each maximal run of three or more consecutive birdie-or-better holes earns one 3 point streak bonus. A complete 18-hole round with no bogey or worse earns +3; a complete 18-hole round under 70 strokes earns +5.

split: open-access


prompt:
A 70 on a par-72 course earns the under-70 bonus.

Score a golf round given [par, strokes] per hole, in tenths: albatross or better 13, eagle 8, birdie 3, par 0.5, bogey -0.5, double bogey or worse -1; any hole-in-one earns +5 on top. Each maximal run of three or more consecutive birdie-or-better holes earns one 3 point streak bonus. A complete 18-hole round with no bogey or worse earns +3; a complete 18-hole round under 70 strokes earns +5.

split: open-access


prompt:
A player at kickoff shows no remaining projection while a nearly finished game shows the whole projection.

Projected final lineup score in tenths. Each player is [actual, full-game projection, status, game seconds left]. Final games count actual points; not-started games count the full projection; live games count actual plus the projection prorated by remaining time over 3600 seconds (floored per player; overtime reports negative seconds, treated as 0 remaining); postponed (ppd) games count 0.

split: open-access


prompt:
During overtime a player's projected total drops below his actual points.

Projected final lineup score in tenths. Each player is [actual, full-game projection, status, game seconds left]. Final games count actual points; not-started games count the full projection; live games count actual plus the projection prorated by remaining time over 3600 seconds (floored per player; overtime reports negative seconds, treated as 0 remaining); postponed (ppd) games count 0.

split: open-access


prompt:
Players in postponed games keep contributing projected points.

Projected final lineup score in tenths. Each player is [actual, full-game projection, status, game seconds left]. Final games count actual points; not-started games count the full projection; live games count actual plus the projection prorated by remaining time over 3600 seconds (floored per player; overtime reports negative seconds, treated as 0 remaining); postponed (ppd) games count 0.

split: open-access


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

N = 1
observations = []
def solve(plays):
    bonus = 0
    for kind, yards, td in plays:
        if td and yards >= 40:
            bonus += 20
        elif td and yards >= 50:
            bonus += 30
        if kind != 'pass' and yards >= 20:
            bonus += 5
    tds = sum(1 for _, _, td in plays if td)
    if tds >= 3:
        bonus += 20
    return bonus
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: tier check order', [[['pass', 5, False], ['rush', 50, True], ['rush', 19, False]]], 35),
  ('partial repair probe: tier check order',
   [[['rec', -3, True], ['pass', 19, False], ['rec', 3, False], ['rush', 5, True], ['pass', 50, True]]], 50),
  ('second regression', [[['rec', 50, True], ['rec', 40, False], ['rec', 39, True]]], 45),
  ('normal control 1', [[['rec', 19, False], ['pass', 40, True]]], 20),
  ('normal control 2', [[['rec', 50, False], ['rec', 5, True], ['rec', 40, False]]], 10),
  ('normal control 3',
   [[['rec', 49, False], ['rush', 49, False], ['pass', 40, False], ['rec', 39, True], ['rec', 19, False],
     ['rush', 5, True]]],
   15),
  ('normal control 4', [[['rec', 19, True]]], 0)],
 [('regression: tier check order',
   [[['rec', 5, False], ['pass', 19, True], ['pass', 50, True], ['rush', 50, False]]], 35),
  ('partial repair probe: tier check order',
   [[['rush', 20, True], ['rec', 50, True], ['pass', 39, False], ['pass', 51, False]]], 40),
  ('second regression', [[['rush', 19, False], ['rush', 50, False], ['pass', 20, True], ['rush', 51, True]]],
   40),
  ('normal control 1', [[['rush', 39, True], ['rec', 40, False], ['pass', 39, True], ['rush', 9, False]]],
   10),
  ('normal control 2', [[['rush', 39, True], ['pass', 40, False]]], 5),
  ('normal control 3', [[['rec', 20, False], ['rush', -3, False], ['rec', -3, True], ['pass', -3, False]]],
   5),
  ('normal control 4', [[['rush', 50, False], ['pass', 49, False], ['rush', 20, True], ['pass', -3, False]]],
   10)],
 [('regression: tier check order', [[['pass', 49, False], ['pass', 51, True]]], 30),
  ('partial repair probe: tier check order', [[['rec', 50, True], ['rec', 50, True], ['rush', 20, True]]],
   95),
  ('second regression',
   [[['rec', 5, True], ['rush', 19, False], ['pass', 41, False], ['rush', 51, True], ['rec', 20, True]]],
   60),
  ('normal control 1',
   [[['rush', 19, True], ['pass', 51, False], ['pass', 39, False], ['pass', 51, False], ['pass', 49, True]]],
   20),
  ('normal control 2',
   [[['pass', 39, False], ['rec', 50, False], ['rec', 50, False], ['rush', 3, True], ['rush', 19, False],
     ['rec', 5, True]]],
   10),
  ('normal control 3', [[['pass', 20, False]]], 0),
  ('normal control 4',
   [[['pass', 39, False], ['rec', 20, True], ['pass', 40, False], ['pass', 41, False], ['pass', 39, False]]],
   5)],
 [('regression: tier check order',
   [[['pass', 50, True], ['pass', 40, True], ['rush', 49, False], ['pass', 43, True]]], 95),
  ('partial repair probe: tier check order', [[['rush', 39, True], ['pass', 50, True], ['pass', 5, False]]],
   35),
  ('second regression', [[['pass', 50, True]]], 30),
  ('normal control 1', [[['pass', 20, True], ['rush', 40, False], ['rush', 39, False], ['pass', 49, True]]],
   30),
  ('normal control 2',
   [[['rush', 39, False], ['rec', 49, False], ['pass', 61, False], ['pass', -3, False], ['rush', 19, True],
     ['rec', 5, False]]],
   10),
  ('normal control 3', [[['rec', 5, False], ['pass', -5, True]]], 0),
  ('normal control 4', [[['rush', 53, False], ['pass', 39, False]]], 5)],
 [('regression: tier check order',
   [[['rush', 50, True], ['rush', 20, True], ['pass', 49, False], ['rec', -3, False]]], 40),
  ('partial repair probe: tier check order',
   [[['rec', 49, False], ['rush', 51, False], ['rush', 51, True], ['rec', 5, True], ['rec', 50, True]]],
   100),
  ('second regression',
   [[['rush', 51, True], ['rec', 55, False], ['rec', 41, True], ['pass', 39, False], ['pass', 5, False]]],
   65),
  ('normal control 1',
   [[['pass', 41, False], ['rush', 40, False], ['rec', 5, False], ['rush', 49, True], ['pass', 49, False]]],
   30),
  ('normal control 2', [[['pass', 51, False], ['pass', -3, False]]], 0),
  ('normal control 3', [[['rec', 19, False]]], 0),
  ('normal control 4', [[['rush', 49, False], ['rush', 20, True], ['rush', 49, False], ['rush', 40, False]]],
   20)]]
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(plays):
    bonus = 0
    for kind, yards, td in plays:
        if td and yards >= 40:
            bonus += 20 + (10 if yards > 50 else 0)
        if kind != 'pass' and yards >= 20:
            bonus += 5
    tds = sum(1 for _, _, td in plays if td)
    if tds >= 3:
        bonus += 20
    return bonus
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: tier check order', [[['pass', 5, False], ['rush', 50, True], ['rush', 19, False]]], 35),
  ('partial repair probe: tier check order',
   [[['rec', -3, True], ['pass', 19, False], ['rec', 3, False], ['rush', 5, True], ['pass', 50, True]]], 50),
  ('second regression', [[['rec', 50, True], ['rec', 40, False], ['rec', 39, True]]], 45),
  ('normal control 1', [[['rec', 19, False], ['pass', 40, True]]], 20),
  ('normal control 2', [[['rec', 50, False], ['rec', 5, True], ['rec', 40, False]]], 10),
  ('normal control 3',
   [[['rec', 49, False], ['rush', 49, False], ['pass', 40, False], ['rec', 39, True], ['rec', 19, False],
     ['rush', 5, True]]],
   15),
  ('normal control 4', [[['rec', 19, True]]], 0)],
 [('regression: tier check order',
   [[['rec', 5, False], ['pass', 19, True], ['pass', 50, True], ['rush', 50, False]]], 35),
  ('partial repair probe: tier check order',
   [[['rush', 20, True], ['rec', 50, True], ['pass', 39, False], ['pass', 51, False]]], 40),
  ('second regression', [[['rush', 19, False], ['rush', 50, False], ['pass', 20, True], ['rush', 51, True]]],
   40),
  ('normal control 1', [[['rush', 39, True], ['rec', 40, False], ['pass', 39, True], ['rush', 9, False]]],
   10),
  ('normal control 2', [[['rush', 39, True], ['pass', 40, False]]], 5),
  ('normal control 3', [[['rec', 20, False], ['rush', -3, False], ['rec', -3, True], ['pass', -3, False]]],
   5),
  ('normal control 4', [[['rush', 50, False], ['pass', 49, False], ['rush', 20, True], ['pass', -3, False]]],
   10)],
 [('regression: tier check order', [[['pass', 49, False], ['pass', 51, True]]], 30),
  ('partial repair probe: tier check order', [[['rec', 50, True], ['rec', 50, True], ['rush', 20, True]]],
   95),
  ('second regression',
   [[['rec', 5, True], ['rush', 19, False], ['pass', 41, False], ['rush', 51, True], ['rec', 20, True]]],
   60),
  ('normal control 1',
   [[['rush', 19, True], ['pass', 51, False], ['pass', 39, False], ['pass', 51, False], ['pass', 49, True]]],
   20),
  ('normal control 2',
   [[['pass', 39, False], ['rec', 50, False], ['rec', 50, False], ['rush', 3, True], ['rush', 19, False],
     ['rec', 5, True]]],
   10),
  ('normal control 3', [[['pass', 20, False]]], 0),
  ('normal control 4',
   [[['pass', 39, False], ['rec', 20, True], ['pass', 40, False], ['pass', 41, False], ['pass', 39, False]]],
   5)],
 [('regression: tier check order',
   [[['pass', 50, True], ['pass', 40, True], ['rush', 49, False], ['pass', 43, True]]], 95),
  ('partial repair probe: tier check order', [[['rush', 39, True], ['pass', 50, True], ['pass', 5, False]]],
   35),
  ('second regression', [[['pass', 50, True]]], 30),
  ('normal control 1', [[['pass', 20, True], ['rush', 40, False], ['rush', 39, False], ['pass', 49, True]]],
   30),
  ('normal control 2',
   [[['rush', 39, False], ['rec', 49, False], ['pass', 61, False], ['pass', -3, False], ['rush', 19, True],
     ['rec', 5, False]]],
   10),
  ('normal control 3', [[['rec', 5, False], ['pass', -5, True]]], 0),
  ('normal control 4', [[['rush', 53, False], ['pass', 39, False]]], 5)],
 [('regression: tier check order',
   [[['rush', 50, True], ['rush', 20, True], ['pass', 49, False], ['rec', -3, False]]], 40),
  ('partial repair probe: tier check order',
   [[['rec', 49, False], ['rush', 51, False], ['rush', 51, True], ['rec', 5, True], ['rec', 50, True]]],
   100),
  ('second regression',
   [[['rush', 51, True], ['rec', 55, False], ['rec', 41, True], ['pass', 39, False], ['pass', 5, False]]],
   65),
  ('normal control 1',
   [[['pass', 41, False], ['rush', 40, False], ['rec', 5, False], ['rush', 49, True], ['pass', 49, False]]],
   30),
  ('normal control 2', [[['pass', 51, False], ['pass', -3, False]]], 0),
  ('normal control 3', [[['rec', 19, False]]], 0),
  ('normal control 4', [[['rush', 49, False], ['rush', 20, True], ['rush', 49, False], ['rush', 40, False]]],
   20)]]
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:
An 80-yard touchdown earns the 40-yard bonus.

Per-play bonus tenths for one player: a touchdown of 50+ yards earns 3, a touchdown of 40-49 yards earns 2 (exclusive tiers); every rushing or receiving play (not passing) of 20+ yards earns 0.5 whether or not it scored; three or more touchdowns in the game earn 2 once.

split: open-access