broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
import math
N = 1
observations = []
def solve(legs, points, stake_cents):
    TABLE = {2: -120, 3: 160, 4: 260, 5: 400}
    wins = 0
    for line, margin in legs:
        adj = Fraction(line) + Fraction(points)
        v = margin + adj
        if v < 0:
            return ['lose', 0]
        if v > 0:
            wins += 1
    if wins < 2:
        return ['refund', stake_cents]
    am = TABLE[min(wins, 5)]
    dec = 1 + (Fraction(am, 100) if am > 0 else Fraction(-am, 100))
    return ['win', math.floor(stake_cents * dec)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
def run(args):
    try:
        return solve(*args)
    except Exception as exc:
        return 'raised ' + type(exc).__name__
cases = [[('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
  ('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
  ('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
  ('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
  ('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
  ('regression: negative line payout', ([['-7.5', 11], ['+3', -5]], '6.5', 1100), ['win', 2016]),
  ('variant scenario 1', ([['-1', -13], ['+7', 14], ['-1', -9]], '6', 1100), ['lose', 0]),
  ('variant scenario 2',
   ([['-7', -3], ['+7', 12], ['+7', -1], ['-7.5', 0], ['-3', -5]], '6.5', 1000),
   ['lose', 0])],
 [('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
  ('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
  ('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
  ('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
  ('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
  ('regression: negative line payout', ([['-7', 7], ['+2.5', 1]], '6', 1000), ['win', 1833]),
  ('variant scenario 1',
   ([['+7', 3], ['+7', -3], ['+3', 8], ['+1.5', 2], ['-1', 13], ['+1.5', 1]], '6', 1100),
   ['win', 5500]),
  ('variant scenario 2',
   ([['+3', 10], ['-6', -4], ['-7.5', 11], ['+3', 3]], '7', 500),
   ['lose', 0])],
 [('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
  ('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
  ('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
  ('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
  ('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
  ('regression: negative line payout',
   ([['-1', 13], ['+3', 6], ['-10', 4]], '6', 1000),
   ['win', 1833]),
  ('variant scenario 1',
   ([['-7.5', 5], ['-7.5', -7], ['+2.5', -5], ['+2.5', 13], ['-7.5', 14], ['-3', 13]], '7', 500),
   ['lose', 0]),
  ('variant scenario 2',
   ([['+7', 10], ['-10', 2], ['-7.5', -11], ['-7', -12], ['+3', -11], ['-7.5', 12]], '6', 1000),
   ['lose', 0])],
 [('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
  ('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
  ('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
  ('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
  ('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
  ('regression: negative line payout', ([['+3', 1], ['+7', 4]], '7', 1000), ['win', 1833]),
  ('variant scenario 1',
   ([['+3', 6], ['+2.5', -10], ['-7', -5], ['-6', -10], ['-7', 4], ['+1.5', 2]], '6.5', 500),
   ['lose', 0]),
  ('variant scenario 2',
   ([['-7', -5], ['-10', 0], ['-3', 4], ['-6', -10], ['+7', 2]], '6', 1100),
   ['lose', 0])],
 [('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
  ('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
  ('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
  ('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
  ('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
  ('regression: negative line payout', ([['+2.5', 1], ['+1.5', 7]], '6', 500), ['win', 916]),
  ('variant scenario 1',
   ([['-7.5', 8], ['-10', -13], ['+3', 2], ['-6', -9]], '6.5', 1000),
   ['lose', 0]),
  ('variant scenario 2',
   ([['-1', -8], ['-6', 1], ['-7.5', 8], ['-7.5', -8]], '7', 1000),
   ['lose', 0])]]
for label, args, expected in cases[N - 1]:
    check(label, run(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
from fractions import Fraction
import math
N = 1
observations = []
def solve(legs, points, stake_cents):
    TABLE = {2: -120, 3: 160, 4: 260, 5: 400}
    wins = 0
    for line, margin in legs:
        adj = Fraction(line) + Fraction(points)
        v = margin + adj
        if v < 0:
            return ['lose', 0]
        if v > 0:
            wins += 1
    if wins < 2:
        return ['refund', stake_cents]
    am = TABLE[min(wins, 5)]
    dec = 1 + (Fraction(am, 100) if am > 0 else Fraction(100, am))
    return ['win', math.floor(stake_cents * dec)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
def run(args):
    try:
        return solve(*args)
    except Exception as exc:
        return 'raised ' + type(exc).__name__
cases = [[('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
  ('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
  ('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
  ('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
  ('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
  ('regression: negative line payout', ([['-7.5', 11], ['+3', -5]], '6.5', 1100), ['win', 2016]),
  ('variant scenario 1', ([['-1', -13], ['+7', 14], ['-1', -9]], '6', 1100), ['lose', 0]),
  ('variant scenario 2',
   ([['-7', -3], ['+7', 12], ['+7', -1], ['-7.5', 0], ['-3', -5]], '6.5', 1000),
   ['lose', 0])],
 [('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
  ('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
  ('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
  ('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
  ('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
  ('regression: negative line payout', ([['-7', 7], ['+2.5', 1]], '6', 1000), ['win', 1833]),
  ('variant scenario 1',
   ([['+7', 3], ['+7', -3], ['+3', 8], ['+1.5', 2], ['-1', 13], ['+1.5', 1]], '6', 1100),
   ['win', 5500]),
  ('variant scenario 2',
   ([['+3', 10], ['-6', -4], ['-7.5', 11], ['+3', 3]], '7', 500),
   ['lose', 0])],
 [('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
  ('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
  ('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
  ('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
  ('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
  ('regression: negative line payout',
   ([['-1', 13], ['+3', 6], ['-10', 4]], '6', 1000),
   ['win', 1833]),
  ('variant scenario 1',
   ([['-7.5', 5], ['-7.5', -7], ['+2.5', -5], ['+2.5', 13], ['-7.5', 14], ['-3', 13]], '7', 500),
   ['lose', 0]),
  ('variant scenario 2',
   ([['+7', 10], ['-10', 2], ['-7.5', -11], ['-7', -12], ['+3', -11], ['-7.5', 12]], '6', 1000),
   ['lose', 0])],
 [('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
  ('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
  ('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
  ('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
  ('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
  ('regression: negative line payout', ([['+3', 1], ['+7', 4]], '7', 1000), ['win', 1833]),
  ('variant scenario 1',
   ([['+3', 6], ['+2.5', -10], ['-7', -5], ['-6', -10], ['-7', 4], ['+1.5', 2]], '6.5', 500),
   ['lose', 0]),
  ('variant scenario 2',
   ([['-7', -5], ['-10', 0], ['-3', 4], ['-6', -10], ['+7', 2]], '6', 1100),
   ['lose', 0])],
 [('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
  ('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
  ('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
  ('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
  ('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
  ('regression: negative line payout', ([['+2.5', 1], ['+1.5', 7]], '6', 500), ['win', 916]),
  ('variant scenario 1',
   ([['-7.5', 8], ['-10', -13], ['+3', 2], ['-6', -9]], '6.5', 1000),
   ['lose', 0]),
  ('variant scenario 2',
   ([['-1', -8], ['-6', 1], ['-7.5', 8], ['-7.5', -8]], '7', 1000),
   ['lose', 0])]]
for label, args, expected in cases[N - 1]:
    check(label, run(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 two-team teaser at -120 pays 2.20 instead of about 1.83.

Point-spread teaser. legs rows are [team spread line, team margin of victory]; every line is moved in the bettor's favour by points (adjusted = line + points). A leg wins if margin + adjusted > 0, pushes if = 0, loses if < 0. Any losing leg loses the ticket. Pushed legs are dropped; fewer than 2 remaining winners refunds the stake. Payout by winning legs from the American table {2: -120, 3: +160, 4: +260, 5: +400} (5 or more pay +400). Return [status, return cents rounded down].

split: open-access


meaning: Fixture-count band, not measured model difficulty

deps: stdlib

prompt:
Teasers with more than five winning legs crash or pay only the stake.

Point-spread teaser. legs rows are [team spread line, team margin of victory]; every line is moved in the bettor's favour by points (adjusted = line + points). A leg wins if margin + adjusted > 0, pushes if = 0, loses if < 0. Any losing leg loses the ticket. Pushed legs are dropped; fewer than 2 remaining winners refunds the stake. Payout by winning legs from the American table {2: -120, 3: +160, 4: +260, 5: +400} (5 or more pay +400). Return [status, return cents rounded down].

split: open-access


prompt:
Draw-no-bet prices ignore the draw refund value in the stated formula.

Derive secondary markets from 1X2 decimal prices [home, draw, away], keeping the original margin. Draw no bet side price = side * (1 - 1/draw). Double chance for two outcomes p, q = p * q / (p + q): 1X from home and draw, 12 from home and away, X2 from draw and away. Return a dict with keys dnb_home, dnb_away, 1X, 12, X2, values rounded half up to two decimals.

split: open-access


prompt:
Double-chance prices sit between the two single prices.

Derive secondary markets from 1X2 decimal prices [home, draw, away], keeping the original margin. Draw no bet side price = side * (1 - 1/draw). Double chance for two outcomes p, q = p * q / (p + q): 1X from home and draw, 12 from home and away, X2 from draw and away. Return a dict with keys dnb_home, dnb_away, 1X, 12, X2, values rounded half up to two decimals.

split: open-access


prompt:
The 12 market shows the same price as 1X.

Derive secondary markets from 1X2 decimal prices [home, draw, away], keeping the original margin. Draw no bet side price = side * (1 - 1/draw). Double chance for two outcomes p, q = p * q / (p + q): 1X from home and draw, 12 from home and away, X2 from draw and away. Return a dict with keys dnb_home, dnb_away, 1X, 12, X2, values rounded half up to two decimals.

split: open-access


prompt:
A 1.20 leg is excluded from the bonus count.

Winning accumulator bonus. Every leg price multiplies the accumulator. Legs priced at 1.20 or more qualify; the bonus percentage by qualifying count is {3: 5, 4: 10, 5: 15, 6: 20, 7: 25} with 7 or more paying 25 and fewer than 3 paying 0. The bonus is applied to the profit only: return = stake + profit * (100 + pct) / 100, rounded down. Return [qualifying legs, bonus pct, return cents].

split: open-access


prompt:
Bonus payouts include a percentage of the stake.

Winning accumulator bonus. Every leg price multiplies the accumulator. Legs priced at 1.20 or more qualify; the bonus percentage by qualifying count is {3: 5, 4: 10, 5: 15, 6: 20, 7: 25} with 7 or more paying 25 and fewer than 3 paying 0. The bonus is applied to the profit only: return = stake + profit * (100 + pct) / 100, rounded down. Return [qualifying legs, bonus pct, return cents].

split: open-access


prompt:
An eight-fold loses its bonus entirely, or is capped at 20 percent.

Winning accumulator bonus. Every leg price multiplies the accumulator. Legs priced at 1.20 or more qualify; the bonus percentage by qualifying count is {3: 5, 4: 10, 5: 15, 6: 20, 7: 25} with 7 or more paying 25 and fewer than 3 paying 0. The bonus is applied to the profit only: return = stake + profit * (100 + pct) / 100, rounded down. Return [qualifying legs, bonus pct, return cents].

split: open-access


prompt:
Short-priced legs push the accumulator into a higher bonus band.

Winning accumulator bonus. Every leg price multiplies the accumulator. Legs priced at 1.20 or more qualify; the bonus percentage by qualifying count is {3: 5, 4: 10, 5: 15, 6: 20, 7: 25} with 7 or more paying 25 and fewer than 3 paying 0. The bonus is applied to the profit only: return = stake + profit * (100 + pct) / 100, rounded down. Return [qualifying legs, bonus pct, return cents].

split: open-access


prompt:
Winners are taxed on their own stake.

Withholding on a settled winning bet. Net winnings = return - stake. If net winnings strictly exceed the threshold, the whole net winnings (not only the excess) are taxed at rate_pct, rounded half up to a cent; otherwise no tax. Return [tax, payout after tax].

split: open-access


prompt:
A win of exactly the threshold is taxed, or one just above it is not.

Withholding on a settled winning bet. Net winnings = return - stake. If net winnings strictly exceed the threshold, the whole net winnings (not only the excess) are taxed at rate_pct, rounded half up to a cent; otherwise no tax. Return [tax, payout after tax].

split: open-access


source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
import math
N = 1
observations = []
def solve(stake_cents, return_cents, threshold_cents, rate_pct):
    net = return_cents - stake_cents
    tax = 0
    if net > threshold_cents:
        tax = math.floor(threshold_cents * Fraction(rate_pct) / 100 + Fraction(1, 2))
    return [tax, return_cents - tax]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
def run(args):
    try:
        return solve(*args)
    except Exception as exc:
        return 'raised ' + type(exc).__name__
cases = [[('control below threshold', (1000, 50000, 60000, '15'), [0, 50000]),
  ('boundary exactly threshold', (1000, 61000, 60000, '15'), [0, 61000]),
  ('boundary one cent above', (1000, 61001, 60000, '15'), [9000, 52001]),
  ('control losing bet', (1000, 0, 60000, '15'), [0, 0]),
  ('control large win', (5000, 105000, 60000, '20'), [20000, 85000]),
  ('regression: cliff versus marginal', (100, 131946, 60000, '20'), [26369, 105577]),
  ('variant scenario 1', (20000, 80000, 60000, '12.5'), [0, 80000]),
  ('variant scenario 2', (100, 0, 60000, '12.5'), [0, 0])],
 [('control below threshold', (1000, 50000, 60000, '15'), [0, 50000]),
  ('boundary exactly threshold', (1000, 61000, 60000, '15'), [0, 61000]),
  ('boundary one cent above', (1000, 61001, 60000, '15'), [9000, 52001]),
  ('control losing bet', (1000, 0, 60000, '15'), [0, 0]),
  ('control large win', (5000, 105000, 60000, '20'), [20000, 85000]),
  ('regression: cliff versus marginal', (100, 60101, 60000, '12.5'), [7500, 52601]),
  ('regression: cliff versus marginal', (20000, 80050, 60000, '20'), [12010, 68040]),
  ('variant scenario 1', (100, 60100, 60000, '12.5'), [0, 60100]),
  ('variant scenario 2', (100, 60100, 60000, '15'), [0, 60100])],
 [('control below threshold', (1000, 50000, 60000, '15'), [0, 50000]),
  ('boundary exactly threshold', (1000, 61000, 60000, '15'), [0, 61000]),
  ('boundary one cent above', (1000, 61001, 60000, '15'), [9000, 52001]),
  ('control losing bet', (1000, 0, 60000, '15'), [0, 0]),
  ('control large win', (5000, 105000, 60000, '20'), [20000, 85000]),
  ('regression: cliff versus marginal', (100, 60150, 60000, '15'), [9008, 51142]),
  ('variant scenario 1', (100, 60101, 60000, '15'), [9000, 51101]),
  ('variant scenario 2', (100, 118085, 60000, '12.5'), [14748, 103337])],
 [('control below threshold', (1000, 50000, 60000, '15'), [0, 50000]),
  ('boundary exactly threshold', (1000, 61000, 60000, '15'), [0, 61000]),
  ('boundary one cent above', (1000, 61001, 60000, '15'), [9000, 52001]),
  ('control losing bet', (1000, 0, 60000, '15'), [0, 0]),
  ('control large win', (5000, 105000, 60000, '20'), [20000, 85000]),
  ('regression: cliff versus marginal', (20000, 90312, 60000, '15'), [10547, 79765]),
  ('variant scenario 1', (5000, 5000, 60000, '12.5'), [0, 5000]),
  ('variant scenario 2', (20000, 0, 60000, '12.5'), [0, 0])],
 [('control below threshold', (1000, 50000, 60000, '15'), [0, 50000]),
  ('boundary exactly threshold', (1000, 61000, 60000, '15'), [0, 61000]),
  ('boundary one cent above', (1000, 61001, 60000, '15'), [9000, 52001]),
  ('control losing bet', (1000, 0, 60000, '15'), [0, 0]),
  ('control large win', (5000, 105000, 60000, '20'), [20000, 85000]),
  ('regression: cliff versus marginal', (100, 60101, 60000, '15'), [9000, 51101]),
  ('regression: cliff versus marginal', (100, 68161, 60000, '12.5'), [8508, 59653]),
  ('variant scenario 1', (20000, 79999, 60000, '12.5'), [0, 79999]),
  ('variant scenario 2', (1000, 61001, 60000, '20'), [12000, 49001])]]
for label, args, expected in cases[N - 1]:
    check(label, run(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:
Large winners pay far less tax than the stated cliff rule requires.

Withholding on a settled winning bet. Net winnings = return - stake. If net winnings strictly exceed the threshold, the whole net winnings (not only the excess) are taxed at rate_pct, rounded half up to a cent; otherwise no tax. Return [tax, payout after tax].

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
import math
N = 1
observations = []
def solve(lay_price, commission_pct):
    L = Fraction(lay_price)
    if L <= 1:
        return 'invalid'
    eq = L - 1
    eff = 1 + (eq - 1) * (100 - Fraction(commission_pct)) / 100
    def fmt(v):
        c = math.floor(v * 1000 + Fraction(1, 2))
        return '%d.%03d' % (c // 1000, c % 1000)
    return [fmt(eq), fmt(eff)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
def run(args):
    try:
        return solve(*args)
    except Exception as exc:
        return 'raised ' + type(exc).__name__
cases = [[('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: equivalence formula', ('1.25', '0'), ['5.000', '5.000']),
  ('variant scenario 1', ('17', '2'), ['1.063', '1.061']),
  ('variant scenario 2', ('17', '5'), ['1.063', '1.059'])],
 [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: equivalence formula', ('1.25', '5'), ['5.000', '4.800']),
  ('variant scenario 1', ('17', '6.5'), ['1.063', '1.058']),
  ('variant scenario 2', ('2.00', '5'), ['2.000', '1.950'])],
 [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: equivalence formula', ('1.58', '2'), ['2.724', '2.690']),
  ('variant scenario 1', ('5.64', '2'), ['1.216', '1.211']),
  ('variant scenario 2', ('9', '0'), ['1.125', '1.125'])],
 [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: equivalence formula', ('33', '2'), ['1.031', '1.031']),
  ('variant scenario 1', ('1.25', '6.5'), ['5.000', '4.740']),
  ('variant scenario 2', ('33', '5'), ['1.031', '1.030'])],
 [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: equivalence formula', ('17', '6.5'), ['1.063', '1.058']),
  ('variant scenario 1', ('33', '0'), ['1.031', '1.031']),
  ('variant scenario 2', ('17', '5'), ['1.063', '1.059'])]]
for label, args, expected in cases[N - 1]:
    check(label, run(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
from fractions import Fraction
import math
N = 1
observations = []
def solve(lay_price, commission_pct):
    L = Fraction(lay_price)
    if L <= 1:
        return 'invalid'
    eq = 1 / (L - 1)
    eff = 1 + (eq - 1) * (100 - Fraction(commission_pct)) / 100
    def fmt(v):
        c = math.floor(v * 1000 + Fraction(1, 2))
        return '%d.%03d' % (c // 1000, c % 1000)
    return [fmt(eq), fmt(eff)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
def run(args):
    try:
        return solve(*args)
    except Exception as exc:
        return 'raised ' + type(exc).__name__
cases = [[('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: equivalence formula', ('1.25', '0'), ['5.000', '5.000']),
  ('variant scenario 1', ('17', '2'), ['1.063', '1.061']),
  ('variant scenario 2', ('17', '5'), ['1.063', '1.059'])],
 [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: equivalence formula', ('1.25', '5'), ['5.000', '4.800']),
  ('variant scenario 1', ('17', '6.5'), ['1.063', '1.058']),
  ('variant scenario 2', ('2.00', '5'), ['2.000', '1.950'])],
 [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: equivalence formula', ('1.58', '2'), ['2.724', '2.690']),
  ('variant scenario 1', ('5.64', '2'), ['1.216', '1.211']),
  ('variant scenario 2', ('9', '0'), ['1.125', '1.125'])],
 [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: equivalence formula', ('33', '2'), ['1.031', '1.031']),
  ('variant scenario 1', ('1.25', '6.5'), ['5.000', '4.740']),
  ('variant scenario 2', ('33', '5'), ['1.031', '1.030'])],
 [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: equivalence formula', ('17', '6.5'), ['1.063', '1.058']),
  ('variant scenario 1', ('33', '0'), ['1.031', '1.031']),
  ('variant scenario 2', ('17', '5'), ['1.063', '1.059'])]]
for label, args, expected in cases[N - 1]:
    check(label, run(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:
Laying at 3.00 is shown as backing the field at 2.00.

Laying a selection at price L (> 1, else "invalid") is equivalent to backing "not this selection" at L / (L - 1). After exchange commission c percent on winnings, the effective price is 1 + (equivalent - 1) * (100 - c) / 100. Return both, rounded half up to three decimals.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
import math
N = 1
observations = []
def solve(lay_price, commission_pct):
    L = Fraction(lay_price)
    if L <= 1:
        return 'invalid'
    eq = L / (L - 1)
    eff = eq * (100 - Fraction(commission_pct)) / 100
    def fmt(v):
        c = math.floor(v * 1000 + Fraction(1, 2))
        return '%d.%03d' % (c // 1000, c % 1000)
    return [fmt(eq), fmt(eff)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
def run(args):
    try:
        return solve(*args)
    except Exception as exc:
        return 'raised ' + type(exc).__name__
cases = [[('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: commission scope', ('8.46', '6.5'), ['1.134', '1.125']),
  ('variant scenario 1', ('33', '0'), ['1.031', '1.031']),
  ('variant scenario 2', ('9', '6.5'), ['1.125', '1.117'])],
 [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: commission scope', ('9', '2'), ['1.125', '1.123']),
  ('variant scenario 1', ('17', '0'), ['1.063', '1.063']),
  ('variant scenario 2', ('5.35', '2'), ['1.230', '1.225'])],
 [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: commission scope', ('1.25', '6.5'), ['5.000', '4.740']),
  ('variant scenario 1', ('1.25', '5'), ['5.000', '4.800']),
  ('variant scenario 2', ('2.03', '0'), ['1.971', '1.971'])],
 [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: commission scope', ('9', '6.5'), ['1.125', '1.117']),
  ('variant scenario 1', ('1.99', '5'), ['2.010', '1.960']),
  ('variant scenario 2', ('33', '5'), ['1.031', '1.030'])],
 [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: commission scope', ('1.25', '2'), ['5.000', '4.920']),
  ('variant scenario 1', ('33', '2'), ['1.031', '1.031']),
  ('variant scenario 2', ('9', '5'), ['1.125', '1.119'])]]
for label, args, expected in cases[N - 1]:
    check(label, run(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
from fractions import Fraction
import math
N = 1
observations = []
def solve(lay_price, commission_pct):
    L = Fraction(lay_price)
    if L <= 1:
        return 'invalid'
    eq = L / (L - 1)
    eff = eq - Fraction(commission_pct) / 100
    def fmt(v):
        c = math.floor(v * 1000 + Fraction(1, 2))
        return '%d.%03d' % (c // 1000, c % 1000)
    return [fmt(eq), fmt(eff)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
def run(args):
    try:
        return solve(*args)
    except Exception as exc:
        return 'raised ' + type(exc).__name__
cases = [[('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: commission scope', ('8.46', '6.5'), ['1.134', '1.125']),
  ('variant scenario 1', ('33', '0'), ['1.031', '1.031']),
  ('variant scenario 2', ('9', '6.5'), ['1.125', '1.117'])],
 [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: commission scope', ('9', '2'), ['1.125', '1.123']),
  ('variant scenario 1', ('17', '0'), ['1.063', '1.063']),
  ('variant scenario 2', ('5.35', '2'), ['1.230', '1.225'])],
 [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: commission scope', ('1.25', '6.5'), ['5.000', '4.740']),
  ('variant scenario 1', ('1.25', '5'), ['5.000', '4.800']),
  ('variant scenario 2', ('2.03', '0'), ['1.971', '1.971'])],
 [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: commission scope', ('9', '6.5'), ['1.125', '1.117']),
  ('variant scenario 1', ('1.99', '5'), ['2.010', '1.960']),
  ('variant scenario 2', ('33', '5'), ['1.031', '1.030'])],
 [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: commission scope', ('1.25', '2'), ['5.000', '4.920']),
  ('variant scenario 1', ('33', '2'), ['1.031', '1.031']),
  ('variant scenario 2', ('9', '5'), ['1.125', '1.119'])]]
for label, args, expected in cases[N - 1]:
    check(label, run(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:
Effective prices are reduced by commission on the stake as well as winnings.

Laying a selection at price L (> 1, else "invalid") is equivalent to backing "not this selection" at L / (L - 1). After exchange commission c percent on winnings, the effective price is 1 + (equivalent - 1) * (100 - c) / 100. Return both, rounded half up to three decimals.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
import math
N = 1
observations = []
def solve(lay_price, commission_pct):
    L = Fraction(lay_price)
    if L <= 1:
        return 'invalid'
    eq = L / (L - 1)
    eff = 1 + (eq - 1) * (100 - Fraction(commission_pct)) / 100
    def fmt(v):
        return '%.3f' % float(v)
    return [fmt(eq), fmt(eff)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
def run(args):
    try:
        return solve(*args)
    except Exception as exc:
        return 'raised ' + type(exc).__name__
cases = [[('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: third decimal rounding', ('33', '5'), ['1.031', '1.030']),
  ('regression: third decimal rounding', ('17', '2'), ['1.063', '1.061']),
  ('variant scenario 1', ('9', '0'), ['1.125', '1.125']),
  ('variant scenario 2', ('33', '6.5'), ['1.031', '1.029'])],
 [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: third decimal rounding', ('9', '6.5'), ['1.125', '1.117']),
  ('regression: third decimal rounding', ('17', '6.5'), ['1.063', '1.058']),
  ('variant scenario 1', ('2.00', '5'), ['2.000', '1.950']),
  ('variant scenario 2', ('1.25', '0'), ['5.000', '5.000'])],
 [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: third decimal rounding', ('33', '2'), ['1.031', '1.031']),
  ('regression: third decimal rounding', ('17', '5'), ['1.063', '1.059']),
  ('variant scenario 1', ('9', '2'), ['1.125', '1.123']),
  ('variant scenario 2', ('9', '0'), ['1.125', '1.125'])],
 [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: third decimal rounding', ('8.31', '5'), ['1.137', '1.130']),
  ('regression: third decimal rounding', ('17', '2'), ['1.063', '1.061']),
  ('variant scenario 1', ('33', '6.5'), ['1.031', '1.029']),
  ('variant scenario 2', ('9', '2'), ['1.125', '1.123'])],
 [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: third decimal rounding', ('33', '5'), ['1.031', '1.030']),
  ('regression: third decimal rounding', ('17', '5'), ['1.063', '1.059']),
  ('variant scenario 1', ('9', '0'), ['1.125', '1.125']),
  ('variant scenario 2', ('9', '6.5'), ['1.125', '1.117'])]]
for label, args, expected in cases[N - 1]:
    check(label, run(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
from fractions import Fraction
import math
N = 1
observations = []
def solve(lay_price, commission_pct):
    L = Fraction(lay_price)
    if L <= 1:
        return 'invalid'
    eq = L / (L - 1)
    eff = 1 + (eq - 1) * (100 - Fraction(commission_pct)) / 100
    def fmt(v):
        c = math.floor(v * 1000)
        return '%d.%03d' % (c // 1000, c % 1000)
    return [fmt(eq), fmt(eff)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
def run(args):
    try:
        return solve(*args)
    except Exception as exc:
        return 'raised ' + type(exc).__name__
cases = [[('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: third decimal rounding', ('33', '5'), ['1.031', '1.030']),
  ('regression: third decimal rounding', ('17', '2'), ['1.063', '1.061']),
  ('variant scenario 1', ('9', '0'), ['1.125', '1.125']),
  ('variant scenario 2', ('33', '6.5'), ['1.031', '1.029'])],
 [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: third decimal rounding', ('9', '6.5'), ['1.125', '1.117']),
  ('regression: third decimal rounding', ('17', '6.5'), ['1.063', '1.058']),
  ('variant scenario 1', ('2.00', '5'), ['2.000', '1.950']),
  ('variant scenario 2', ('1.25', '0'), ['5.000', '5.000'])],
 [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: third decimal rounding', ('33', '2'), ['1.031', '1.031']),
  ('regression: third decimal rounding', ('17', '5'), ['1.063', '1.059']),
  ('variant scenario 1', ('9', '2'), ['1.125', '1.123']),
  ('variant scenario 2', ('9', '0'), ['1.125', '1.125'])],
 [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: third decimal rounding', ('8.31', '5'), ['1.137', '1.130']),
  ('regression: third decimal rounding', ('17', '2'), ['1.063', '1.061']),
  ('variant scenario 1', ('33', '6.5'), ['1.031', '1.029']),
  ('variant scenario 2', ('9', '2'), ['1.125', '1.123'])],
 [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),
  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),
  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),
  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),
  ('regression: third decimal rounding', ('33', '5'), ['1.031', '1.030']),
  ('regression: third decimal rounding', ('17', '5'), ['1.063', '1.059']),
  ('variant scenario 1', ('9', '0'), ['1.125', '1.125']),
  ('variant scenario 2', ('9', '6.5'), ['1.125', '1.117'])]]
for label, args, expected in cases[N - 1]:
    check(label, run(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:
Laying at 17 shows 1.062 instead of 1.063.

Laying a selection at price L (> 1, else "invalid") is equivalent to backing "not this selection" at L / (L - 1). After exchange commission c percent on winnings, the effective price is 1 + (equivalent - 1) * (100 - c) / 100. Return both, rounded half up to three decimals.

split: open-access


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

N = 1
observations = []
def solve(stats, fmt, pos):
    def unit(y, per):
        return y // per
    rec_val = {'std': 0, 'half': 50, 'ppr': 100}[fmt]
    if pos == 'TE':
        rec_val += 50
    pts = 0
    pts += unit(stats['pass_yds'], 25) * 100
    pts += stats['pass_td'] * 400
    pts -= stats['int'] * 200
    pts += unit(stats['rush_yds'], 10) * 100
    pts += stats['rush_td'] * 600
    pts += stats['rec'] * rec_val
    pts += unit(stats['rec_yds'], 10) * 100
    pts += stats['rec_td'] * 600
    pts -= stats['fum_lost'] * 200
    pts += stats['two_pt'] * 200
    pts += stats['first_downs'] * 25
    if stats['pass_yds'] >= 300:
        pts += 300
    if stats['rush_yds'] >= 100:
        pts += 300
    if stats['rec_yds'] >= 100:
        pts += 300
    t = (abs(pts) + 5) // 10
    sign = '-' if pts < 0 and t else ''
    return {'hundredths': pts, 'display': '%s%d.%d' % (sign, t // 10, t % 10)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: negative yardage truncation',
   [{'first_downs': 1,
     'fum': 1,
     'fum_lost': 0,
     'int': 3,
     'pass_td': 1,
     'pass_yds': 288,
     'rec': 7,
     'rec_td': 0,
     'rec_yds': 20,
     'rush_td': 1,
     'rush_yds': -7,
     'two_pt': 0},
    'std', 'QB'],
   {'display': '17.3', 'hundredths': 1725}),
  ('partial repair probe: negative yardage truncation',
   [{'first_downs': 7,
     'fum': 0,
     'fum_lost': 0,
     'int': 0,
     'pass_td': 0,
     'pass_yds': 235,
     'rec': 2,
     'rec_td': 2,
     'rec_yds': 4,
     'rush_td': 2,
     'rush_yds': -10,
     'two_pt': 1},
    'std', 'QB'],
   {'display': '35.8', 'hundredths': 3575}),
  ('second regression',
   [{'first_downs': 4,
     'fum': 2,
     'fum_lost': 2,
     'int': 1,
     'pass_td': 0,
     'pass_yds': 6,
     'rec': 0,
     'rec_td': 0,
     'rec_yds': 0,
     'rush_td': 0,
     'rush_yds': -4,
     'two_pt': 0},
    'ppr', 'WR'],
   {'display': '-5.0', 'hundredths': -500}),
  ('normal control 1',
   [{'first_downs': 4,
     'fum': 1,
     'fum_lost': 0,
     'int': 2,
     'pass_td': 2,
     'pass_yds': 311,
     'rec': 7,
     'rec_td': 2,
     'rec_yds': 140,
     'rush_td': 1,
     'rush_yds': 64,
     'two_pt': 1},
    'std', 'RB'],
   {'display': '63.0', 'hundredths': 6300}),
  ('normal control 2',
   [{'first_downs': 1,
     'fum': 3,
     'fum_lost': 0,
     'int': 3,
     'pass_td': 2,
     'pass_yds': 239,
     'rec': 2,
     'rec_td': 2,
     'rec_yds': 141,
     'rush_td': 0,
     'rush_yds': 107,
     'two_pt': 1},
    'std', 'WR'],
   {'display': '55.3', 'hundredths': 5525}),
  ('normal control 3',
   [{'first_downs': 1,
     'fum': 2,
     'fum_lost': 2,
     'int': 3,
     'pass_td': 2,
     'pass_yds': 347,
     'rec': 11,
     'rec_td': 1,
     'rec_yds': 19,
     'rush_td': 1,
     'rush_yds': 108,
     'two_pt': 0},
    'half', 'RB'],
   {'display': '45.8', 'hundredths': 4575}),
  ('normal control 4',
   [{'first_downs': 1,
     'fum': 3,
     'fum_lost': 3,
     'int': 1,
     'pass_td': 3,
     'pass_yds': 46,
     'rec': 1,
     'rec_td': 2,
     'rec_yds': 110,
     'rush_td': 1,
     'rush_yds': 118,
     'two_pt': 0},
    'std', 'TE'],
   {'display': '51.8', 'hundredths': 5175})],
 [('regression: negative yardage truncation',
   [{'first_downs': 1,
     'fum': 2,
     'fum_lost': 1,
     'int': 3,
     'pass_td': 3,
     'pass_yds': -3,
     'rec': 1,
     'rec_td': 1,
     'rec_yds': 7,
     'rush_td': 0,
     'rush_yds': 100,
     'two_pt': 0},
    'std', 'RB'],
   {'display': '23.3', 'hundredths': 2325}),
  ('partial repair probe: negative yardage truncation',
   [{'first_downs': 3,
     'fum': 2,
     'fum_lost': 2,
     'int': 2,
     'pass_td': 4,
     'pass_yds': -3,
     'rec': 3,
     'rec_td': 1,
     'rec_yds': 99,
     'rush_td': 1,
     'rush_yds': -10,
     'two_pt': 1},
    'half', 'WR'],
   {'display': '32.3', 'hundredths': 3225}),
  ('second regression',
   [{'first_downs': 3,
     'fum': 2,
     'fum_lost': 0,
     'int': 1,
     'pass_td': 0,
     'pass_yds': 86,
     'rec': 10,
     'rec_td': 1,
     'rec_yds': 19,
     'rush_td': 1,
     'rush_yds': -7,
     'two_pt': 1},
    'half', 'WR'],
   {'display': '21.8', 'hundredths': 2175}),
  ('normal control 1',
   [{'first_downs': 5,
     'fum': 0,
     'fum_lost': 0,
     'int': 0,
     'pass_td': 2,
     'pass_yds': 107,
     'rec': 4,
     'rec_td': 1,
     'rec_yds': 99,
     'rush_td': 1,
     'rush_yds': 106,
     'two_pt': 1},
    'std', 'WR'],
   {'display': '49.3', 'hundredths': 4925}),
  ('normal control 2',
   [{'first_downs': 9,
     'fum': 2,
     'fum_lost': 2,
     'int': 0,
     'pass_td': 0,
     'pass_yds': 20,
     'rec': 0,
     'rec_td': 0,
     'rec_yds': 0,
     'rush_td': 0,
     'rush_yds': 9,
     'two_pt': 0},
    'std', 'WR'],
   {'display': '-1.8', 'hundredths': -175}),
  ('normal control 3',
   [{'first_downs': 9,
     'fum': 1,
     'fum_lost': 1,
     'int': 1,
     'pass_td': 0,
     'pass_yds': 198,
     'rec': 7,
     'rec_td': 1,
     'rec_yds': 20,
     'rush_td': 1,
     'rush_yds': 51,
     'two_pt': 1},
    'std', 'WR'],
   {'display': '26.3', 'hundredths': 2625}),
  ('normal control 4',
   [{'first_downs': 7,
     'fum': 3,
     'fum_lost': 2,
     'int': 1,
     'pass_td': 4,
     'pass_yds': 300,
     'rec': 11,
     'rec_td': 1,
     'rec_yds': 114,
     'rush_td': 1,
     'rush_yds': 10,
     'two_pt': 0},
    'ppr', 'WR'],
   {'display': '64.8', 'hundredths': 6475})],
 [('regression: negative yardage truncation',
   [{'first_downs': 9,
     'fum': 2,
     'fum_lost': 0,
     'int': 2,
     'pass_td': 3,
     'pass_yds': -3,
     'rec': 10,
     'rec_td': 0,
     'rec_yds': 86,
     'rush_td': 2,
     'rush_yds': 51,
     'two_pt': 1},
    'ppr', 'TE'],
   {'display': '52.3', 'hundredths': 5225}),
  ('partial repair probe: negative yardage truncation',
   [{'first_downs': 1,
     'fum': 2,
     'fum_lost': 1,
     'int': 0,
     'pass_td': 0,
     'pass_yds': 15,
     'rec': 0,
     'rec_td': 0,
     'rec_yds': 0,
     'rush_td': 0,
     'rush_yds': -14,
     'two_pt': 0},
    'std', 'TE'],
   {'display': '-2.8', 'hundredths': -275}),
  ('second regression',
   [{'first_downs': 4,
     'fum': 1,
     'fum_lost': 1,
     'int': 1,
     'pass_td': 3,
     'pass_yds': 298,
     'rec': 0,
     'rec_td': 1,
     'rec_yds': 99,
     'rush_td': 1,
     'rush_yds': -7,
     'two_pt': 1},
    'std', 'QB'],
   {'display': '43.0', 'hundredths': 4300}),
  ('normal control 1',
   [{'first_downs': 4,
     'fum': 2,
     'fum_lost': 2,
     'int': 1,
     'pass_td': 0,
     'pass_yds': 325,
     'rec': 10,
     'rec_td': 1,
     'rec_yds': 99,
     'rush_td': 0,
     'rush_yds': 159,
     'two_pt': 0},
    'ppr', 'QB'],
   {'display': '54.0', 'hundredths': 5400}),
  ('normal control 2',
   [{'first_downs': 3,
     'fum': 1,
     'fum_lost': 1,
     'int': 2,
     'pass_td': 2,
     'pass_yds': 63,
     'rec': 0,
     'rec_td': 0,
     'rec_yds': 60,
     'rush_td': 2,
     'rush_yds': 146,
     'two_pt': 1},
    'ppr', 'WR'],
   {'display': '41.8', 'hundredths': 4175}),
  ('normal control 3',
   [{'first_downs': 3,
     'fum': 2,
     'fum_lost': 1,
     'int': 3,
     'pass_td': 0,
     'pass_yds': 2,
     'rec': 0,
     'rec_td': 0,
     'rec_yds': 0,
     'rush_td': 0,
     'rush_yds': 0,
     'two_pt': 0},
    'ppr', 'RB'],
   {'display': '-7.3', 'hundredths': -725}),
  ('normal control 4',
   [{'first_downs': 3,
     'fum': 1,
     'fum_lost': 0,
     'int': 1,
     'pass_td': 0,
     'pass_yds': 325,
     'rec': 10,
     'rec_td': 2,
     'rec_yds': 84,
     'rush_td': 0,
     'rush_yds': 35,
     'two_pt': 1},
    'std', 'TE'],
   {'display': '44.8', 'hundredths': 4475})],
 [('regression: negative yardage truncation',
   [{'first_downs': 9,
     'fum': 2,
     'fum_lost': 2,
     'int': 1,
     'pass_td': 0,
     'pass_yds': 16,
     'rec': 0,
     'rec_td': 0,
     'rec_yds': 0,
     'rush_td': 0,
     'rush_yds': -7,
     'two_pt': 0},
    'half', 'QB'],
   {'display': '-3.8', 'hundredths': -375}),
  ('partial repair probe: negative yardage truncation',
   [{'first_downs': 9,
     'fum': 2,
     'fum_lost': 0,
     'int': 2,
     'pass_td': 4,
     'pass_yds': 57,
     'rec': 10,
     'rec_td': 1,
     'rec_yds': 45,
     'rush_td': 0,
     'rush_yds': -10,
     'two_pt': 0},
    'ppr', 'WR'],
   {'display': '35.3', 'hundredths': 3525}),
  ('second regression',
   [{'first_downs': 0,
     'fum': 2,
     'fum_lost': 1,
     'int': 1,
     'pass_td': 0,
     'pass_yds': -10,
     'rec': 0,
     'rec_td': 0,
     'rec_yds': 0,
     'rush_td': 0,
     'rush_yds': -7,
     'two_pt': 0},
    'std', 'WR'],
   {'display': '-4.0', 'hundredths': -400}),
  ('normal control 1',
   [{'first_downs': 8,
     'fum': 1,
     'fum_lost': 1,
     'int': 2,
     'pass_td': 3,
     'pass_yds': 228,
     'rec': 4,
     'rec_td': 1,
     'rec_yds': 106,
     'rush_td': 2,
     'rush_yds': 77,
     'two_pt': 1},
    'half', 'QB'],
   {'display': '59.0', 'hundredths': 5900}),
  ('normal control 2',
   [{'first_downs': 9,
     'fum': 1,
     'fum_lost': 1,
     'int': 3,
     'pass_td': 3,
     'pass_yds': 25,
     'rec': 9,
     'rec_td': 2,
     'rec_yds': 99,
     'rush_td': 0,
     'rush_yds': 139,
     'two_pt': 0},
    'ppr', 'TE'],
   {'display': '57.8', 'hundredths': 5775}),
  ('normal control 3',
   [{'first_downs': 0,
     'fum': 2,
     'fum_lost': 2,
     'int': 2,
     'pass_td': 0,
     'pass_yds': 37,
     'rec': 0,
     'rec_td': 0,
     'rec_yds': 0,
     'rush_td': 0,
     'rush_yds': 2,
     'two_pt': 0},
    'std', 'RB'],
   {'display': '-7.0', 'hundredths': -700}),
  ('normal control 4',
   [{'first_downs': 7,
     'fum': 3,
     'fum_lost': 2,
     'int': 2,
     'pass_td': 4,
     'pass_yds': 299,
     'rec': 4,
     'rec_td': 1,
     'rec_yds': 51,
     'rush_td': 1,
     'rush_yds': 158,
     'two_pt': 1},
    'half', 'TE'],
   {'display': '61.8', 'hundredths': 6175})],
 [('regression: negative yardage truncation',
   [{'first_downs': 5,
     'fum': 2,
     'fum_lost': 1,
     'int': 1,
     'pass_td': 0,
     'pass_yds': 8,
     'rec': 0,
     'rec_td': 0,
     'rec_yds': 0,
     'rush_td': 0,
     'rush_yds': -8,
     'two_pt': 0},
    'std', 'RB'],
   {'display': '-2.8', 'hundredths': -275}),
  ('partial repair probe: negative yardage truncation',
   [{'first_downs': 3,
     'fum': 0,
     'fum_lost': 0,
     'int': 0,
     'pass_td': 0,
     'pass_yds': 64,
     'rec': 11,
     'rec_td': 0,
     'rec_yds': 7,
     'rush_td': 0,
     'rush_yds': -10,
     'two_pt': 0},
    'half', 'TE'],
   {'display': '12.8', 'hundredths': 1275}),
  ('second regression',
   [{'first_downs': 7,
     'fum': 3,
     'fum_lost': 2,
     'int': 0,
     'pass_td': 1,
     'pass_yds': -3,
     'rec': 3,
     'rec_td': 2,
     'rec_yds': 7,
     'rush_td': 1,
     'rush_yds': 99,
     'two_pt': 0},
    'ppr', 'WR'],
   {'display': '31.8', 'hundredths': 3175}),
  ('normal control 1',
   [{'first_downs': 8,
     'fum': 2,
     'fum_lost': 1,
     'int': 2,
     'pass_td': 0,
     'pass_yds': 21,
     'rec': 0,
     'rec_td': 0,
     'rec_yds': 0,
     'rush_td': 0,
     'rush_yds': 1,
     'two_pt': 0},
    'ppr', 'TE'],
   {'display': '-4.0', 'hundredths': -400}),
  ('normal control 2',
   [{'first_downs': 4,
     'fum': 3,
     'fum_lost': 1,
     'int': 2,
     'pass_td': 3,
     'pass_yds': 331,
     'rec': 0,
     'rec_td': 0,
     'rec_yds': 20,
     'rush_td': 1,
     'rush_yds': 0,
     'two_pt': 0},
    'ppr', 'TE'],
   {'display': '31.0', 'hundredths': 3100}),
  ('normal control 3',
   [{'first_downs': 2,
     'fum': 2,
     'fum_lost': 2,
     'int': 3,
     'pass_td': 2,
     'pass_yds': 52,
     'rec': 4,
     'rec_td': 0,
     'rec_yds': 99,
     'rush_td': 1,
     'rush_yds': 100,
     'two_pt': 0},
    'half', 'QB'],
   {'display': '30.5', 'hundredths': 3050}),
  ('normal control 4',
   [{'first_downs': 5,
     'fum': 1,
     'fum_lost': 0,
     'int': 1,
     'pass_td': 0,
     'pass_yds': 85,
     'rec': 5,
     'rec_td': 0,
     'rec_yds': 19,
     'rush_td': 0,
     'rush_yds': 47,
     'two_pt': 0},
    'half', 'WR'],
   {'display': '9.8', 'hundredths': 975})]]
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(stats, fmt, pos):
    def unit(y, per):
        return abs(y) // per
    rec_val = {'std': 0, 'half': 50, 'ppr': 100}[fmt]
    if pos == 'TE':
        rec_val += 50
    pts = 0
    pts += unit(stats['pass_yds'], 25) * 100
    pts += stats['pass_td'] * 400
    pts -= stats['int'] * 200
    pts += unit(stats['rush_yds'], 10) * 100
    pts += stats['rush_td'] * 600
    pts += stats['rec'] * rec_val
    pts += unit(stats['rec_yds'], 10) * 100
    pts += stats['rec_td'] * 600
    pts -= stats['fum_lost'] * 200
    pts += stats['two_pt'] * 200
    pts += stats['first_downs'] * 25
    if stats['pass_yds'] >= 300:
        pts += 300
    if stats['rush_yds'] >= 100:
        pts += 300
    if stats['rec_yds'] >= 100:
        pts += 300
    t = (abs(pts) + 5) // 10
    sign = '-' if pts < 0 and t else ''
    return {'hundredths': pts, 'display': '%s%d.%d' % (sign, t // 10, t % 10)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: negative yardage truncation',
   [{'first_downs': 1,
     'fum': 1,
     'fum_lost': 0,
     'int': 3,
     'pass_td': 1,
     'pass_yds': 288,
     'rec': 7,
     'rec_td': 0,
     'rec_yds': 20,
     'rush_td': 1,
     'rush_yds': -7,
     'two_pt': 0},
    'std', 'QB'],
   {'display': '17.3', 'hundredths': 1725}),
  ('partial repair probe: negative yardage truncation',
   [{'first_downs': 7,
     'fum': 0,
     'fum_lost': 0,
     'int': 0,
     'pass_td': 0,
     'pass_yds': 235,
     'rec': 2,
     'rec_td': 2,
     'rec_yds': 4,
     'rush_td': 2,
     'rush_yds': -10,
     'two_pt': 1},
    'std', 'QB'],
   {'display': '35.8', 'hundredths': 3575}),
  ('second regression',
   [{'first_downs': 4,
     'fum': 2,
     'fum_lost': 2,
     'int': 1,
     'pass_td': 0,
     'pass_yds': 6,
     'rec': 0,
     'rec_td': 0,
     'rec_yds': 0,
     'rush_td': 0,
     'rush_yds': -4,
     'two_pt': 0},
    'ppr', 'WR'],
   {'display': '-5.0', 'hundredths': -500}),
  ('normal control 1',
   [{'first_downs': 4,
     'fum': 1,
     'fum_lost': 0,
     'int': 2,
     'pass_td': 2,
     'pass_yds': 311,
     'rec': 7,
     'rec_td': 2,
     'rec_yds': 140,
     'rush_td': 1,
     'rush_yds': 64,
     'two_pt': 1},
    'std', 'RB'],
   {'display': '63.0', 'hundredths': 6300}),
  ('normal control 2',
   [{'first_downs': 1,
     'fum': 3,
     'fum_lost': 0,
     'int': 3,
     'pass_td': 2,
     'pass_yds': 239,
     'rec': 2,
     'rec_td': 2,
     'rec_yds': 141,
     'rush_td': 0,
     'rush_yds': 107,
     'two_pt': 1},
    'std', 'WR'],
   {'display': '55.3', 'hundredths': 5525}),
  ('normal control 3',
   [{'first_downs': 1,
     'fum': 2,
     'fum_lost': 2,
     'int': 3,
     'pass_td': 2,
     'pass_yds': 347,
     'rec': 11,
     'rec_td': 1,
     'rec_yds': 19,
     'rush_td': 1,
     'rush_yds': 108,
     'two_pt': 0},
    'half', 'RB'],
   {'display': '45.8', 'hundredths': 4575}),
  ('normal control 4',
   [{'first_downs': 1,
     'fum': 3,
     'fum_lost': 3,
     'int': 1,
     'pass_td': 3,
     'pass_yds': 46,
     'rec': 1,
     'rec_td': 2,
     'rec_yds': 110,
     'rush_td': 1,
     'rush_yds': 118,
     'two_pt': 0},
    'std', 'TE'],
   {'display': '51.8', 'hundredths': 5175})],
 [('regression: negative yardage truncation',
   [{'first_downs': 1,
     'fum': 2,
     'fum_lost': 1,
     'int': 3,
     'pass_td': 3,
     'pass_yds': -3,
     'rec': 1,
     'rec_td': 1,
     'rec_yds': 7,
     'rush_td': 0,
     'rush_yds': 100,
     'two_pt': 0},
    'std', 'RB'],
   {'display': '23.3', 'hundredths': 2325}),
  ('partial repair probe: negative yardage truncation',
   [{'first_downs': 3,
     'fum': 2,
     'fum_lost': 2,
     'int': 2,
     'pass_td': 4,
     'pass_yds': -3,
     'rec': 3,
     'rec_td': 1,
     'rec_yds': 99,
     'rush_td': 1,
     'rush_yds': -10,
     'two_pt': 1},
    'half', 'WR'],
   {'display': '32.3', 'hundredths': 3225}),
  ('second regression',
   [{'first_downs': 3,
     'fum': 2,
     'fum_lost': 0,
     'int': 1,
     'pass_td': 0,
     'pass_yds': 86,
     'rec': 10,
     'rec_td': 1,
     'rec_yds': 19,
     'rush_td': 1,
     'rush_yds': -7,
     'two_pt': 1},
    'half', 'WR'],
   {'display': '21.8', 'hundredths': 2175}),
  ('normal control 1',
   [{'first_downs': 5,
     'fum': 0,
     'fum_lost': 0,
     'int': 0,
     'pass_td': 2,
     'pass_yds': 107,
     'rec': 4,
     'rec_td': 1,
     'rec_yds': 99,
     'rush_td': 1,
     'rush_yds': 106,
     'two_pt': 1},
    'std', 'WR'],
   {'display': '49.3', 'hundredths': 4925}),
  ('normal control 2',
   [{'first_downs': 9,
     'fum': 2,
     'fum_lost': 2,
     'int': 0,
     'pass_td': 0,
     'pass_yds': 20,
     'rec': 0,
     'rec_td': 0,
     'rec_yds': 0,
     'rush_td': 0,
     'rush_yds': 9,
     'two_pt': 0},
    'std', 'WR'],
   {'display': '-1.8', 'hundredths': -175}),
  ('normal control 3',
   [{'first_downs': 9,
     'fum': 1,
     'fum_lost': 1,
     'int': 1,
     'pass_td': 0,
     'pass_yds': 198,
     'rec': 7,
     'rec_td': 1,
     'rec_yds': 20,
     'rush_td': 1,
     'rush_yds': 51,
     'two_pt': 1},
    'std', 'WR'],
   {'display': '26.3', 'hundredths': 2625}),
  ('normal control 4',
   [{'first_downs': 7,
     'fum': 3,
     'fum_lost': 2,
     'int': 1,
     'pass_td': 4,
     'pass_yds': 300,
     'rec': 11,
     'rec_td': 1,
     'rec_yds': 114,
     'rush_td': 1,
     'rush_yds': 10,
     'two_pt': 0},
    'ppr', 'WR'],
   {'display': '64.8', 'hundredths': 6475})],
 [('regression: negative yardage truncation',
   [{'first_downs': 9,
     'fum': 2,
     'fum_lost': 0,
     'int': 2,
     'pass_td': 3,
     'pass_yds': -3,
     'rec': 10,
     'rec_td': 0,
     'rec_yds': 86,
     'rush_td': 2,
     'rush_yds': 51,
     'two_pt': 1},
    'ppr', 'TE'],
   {'display': '52.3', 'hundredths': 5225}),
  ('partial repair probe: negative yardage truncation',
   [{'first_downs': 1,
     'fum': 2,
     'fum_lost': 1,
     'int': 0,
     'pass_td': 0,
     'pass_yds': 15,
     'rec': 0,
     'rec_td': 0,
     'rec_yds': 0,
     'rush_td': 0,
     'rush_yds': -14,
     'two_pt': 0},
    'std', 'TE'],
   {'display': '-2.8', 'hundredths': -275}),
  ('second regression',
   [{'first_downs': 4,
     'fum': 1,
     'fum_lost': 1,
     'int': 1,
     'pass_td': 3,
     'pass_yds': 298,
     'rec': 0,
     'rec_td': 1,
     'rec_yds': 99,
     'rush_td': 1,
     'rush_yds': -7,
     'two_pt': 1},
    'std', 'QB'],
   {'display': '43.0', 'hundredths': 4300}),
  ('normal control 1',
   [{'first_downs': 4,
     'fum': 2,
     'fum_lost': 2,
     'int': 1,
     'pass_td': 0,
     'pass_yds': 325,
     'rec': 10,
     'rec_td': 1,
     'rec_yds': 99,
     'rush_td': 0,
     'rush_yds': 159,
     'two_pt': 0},
    'ppr', 'QB'],
   {'display': '54.0', 'hundredths': 5400}),
  ('normal control 2',
   [{'first_downs': 3,
     'fum': 1,
     'fum_lost': 1,
     'int': 2,
     'pass_td': 2,
     'pass_yds': 63,
     'rec': 0,
     'rec_td': 0,
     'rec_yds': 60,
     'rush_td': 2,
     'rush_yds': 146,
     'two_pt': 1},
    'ppr', 'WR'],
   {'display': '41.8', 'hundredths': 4175}),
  ('normal control 3',
   [{'first_downs': 3,
     'fum': 2,
     'fum_lost': 1,
     'int': 3,
     'pass_td': 0,
     'pass_yds': 2,
     'rec': 0,
     'rec_td': 0,
     'rec_yds': 0,
     'rush_td': 0,
     'rush_yds': 0,
     'two_pt': 0},
    'ppr', 'RB'],
   {'display': '-7.3', 'hundredths': -725}),
  ('normal control 4',
   [{'first_downs': 3,
     'fum': 1,
     'fum_lost': 0,
     'int': 1,
     'pass_td': 0,
     'pass_yds': 325,
     'rec': 10,
     'rec_td': 2,
     'rec_yds': 84,
     'rush_td': 0,
     'rush_yds': 35,
     'two_pt': 1},
    'std', 'TE'],
   {'display': '44.8', 'hundredths': 4475})],
 [('regression: negative yardage truncation',
   [{'first_downs': 9,
     'fum': 2,
     'fum_lost': 2,
     'int': 1,
     'pass_td': 0,
     'pass_yds': 16,
     'rec': 0,
     'rec_td': 0,
     'rec_yds': 0,
     'rush_td': 0,
     'rush_yds': -7,
     'two_pt': 0},
    'half', 'QB'],
   {'display': '-3.8', 'hundredths': -375}),
  ('partial repair probe: negative yardage truncation',
   [{'first_downs': 9,
     'fum': 2,
     'fum_lost': 0,
     'int': 2,
     'pass_td': 4,
     'pass_yds': 57,
     'rec': 10,
     'rec_td': 1,
     'rec_yds': 45,
     'rush_td': 0,
     'rush_yds': -10,
     'two_pt': 0},
    'ppr', 'WR'],
   {'display': '35.3', 'hundredths': 3525}),
  ('second regression',
   [{'first_downs': 0,
     'fum': 2,
     'fum_lost': 1,
     'int': 1,
     'pass_td': 0,
     'pass_yds': -10,
     'rec': 0,
     'rec_td': 0,
     'rec_yds': 0,
     'rush_td': 0,
     'rush_yds': -7,
     'two_pt': 0},
    'std', 'WR'],
   {'display': '-4.0', 'hundredths': -400}),
  ('normal control 1',
   [{'first_downs': 8,
     'fum': 1,
     'fum_lost': 1,
     'int': 2,
     'pass_td': 3,
     'pass_yds': 228,
     'rec': 4,
     'rec_td': 1,
     'rec_yds': 106,
     'rush_td': 2,
     'rush_yds': 77,
     'two_pt': 1},
    'half', 'QB'],
   {'display': '59.0', 'hundredths': 5900}),
  ('normal control 2',
   [{'first_downs': 9,
     'fum': 1,
     'fum_lost': 1,
     'int': 3,
     'pass_td': 3,
     'pass_yds': 25,
     'rec': 9,
     'rec_td': 2,
     'rec_yds': 99,
     'rush_td': 0,
     'rush_yds': 139,
     'two_pt': 0},
    'ppr', 'TE'],
   {'display': '57.8', 'hundredths': 5775}),
  ('normal control 3',
   [{'first_downs': 0,
     'fum': 2,
     'fum_lost': 2,
     'int': 2,
     'pass_td': 0,
     'pass_yds': 37,
     'rec': 0,
     'rec_td': 0,
     'rec_yds': 0,
     'rush_td': 0,
     'rush_yds': 2,
     'two_pt': 0},
    'std', 'RB'],
   {'display': '-7.0', 'hundredths': -700}),
  ('normal control 4',
   [{'first_downs': 7,
     'fum': 3,
     'fum_lost': 2,
     'int': 2,
     'pass_td': 4,
     'pass_yds': 299,
     'rec': 4,
     'rec_td': 1,
     'rec_yds': 51,
     'rush_td': 1,
     'rush_yds': 158,
     'two_pt': 1},
    'half', 'TE'],
   {'display': '61.8', 'hundredths': 6175})],
 [('regression: negative yardage truncation',
   [{'first_downs': 5,
     'fum': 2,
     'fum_lost': 1,
     'int': 1,
     'pass_td': 0,
     'pass_yds': 8,
     'rec': 0,
     'rec_td': 0,
     'rec_yds': 0,
     'rush_td': 0,
     'rush_yds': -8,
     'two_pt': 0},
    'std', 'RB'],
   {'display': '-2.8', 'hundredths': -275}),
  ('partial repair probe: negative yardage truncation',
   [{'first_downs': 3,
     'fum': 0,
     'fum_lost': 0,
     'int': 0,
     'pass_td': 0,
     'pass_yds': 64,
     'rec': 11,
     'rec_td': 0,
     'rec_yds': 7,
     'rush_td': 0,
     'rush_yds': -10,
     'two_pt': 0},
    'half', 'TE'],
   {'display': '12.8', 'hundredths': 1275}),
  ('second regression',
   [{'first_downs': 7,
     'fum': 3,
     'fum_lost': 2,
     'int': 0,
     'pass_td': 1,
     'pass_yds': -3,
     'rec': 3,
     'rec_td': 2,
     'rec_yds': 7,
     'rush_td': 1,
     'rush_yds': 99,
     'two_pt': 0},
    'ppr', 'WR'],
   {'display': '31.8', 'hundredths': 3175}),
  ('normal control 1',
   [{'first_downs': 8,
     'fum': 2,
     'fum_lost': 1,
     'int': 2,
     'pass_td': 0,
     'pass_yds': 21,
     'rec': 0,
     'rec_td': 0,
     'rec_yds': 0,
     'rush_td': 0,
     'rush_yds': 1,
     'two_pt': 0},
    'ppr', 'TE'],
   {'display': '-4.0', 'hundredths': -400}),
  ('normal control 2',
   [{'first_downs': 4,
     'fum': 3,
     'fum_lost': 1,
     'int': 2,
     'pass_td': 3,
     'pass_yds': 331,
     'rec': 0,
     'rec_td': 0,
     'rec_yds': 20,
     'rush_td': 1,
     'rush_yds': 0,
     'two_pt': 0},
    'ppr', 'TE'],
   {'display': '31.0', 'hundredths': 3100}),
  ('normal control 3',
   [{'first_downs': 2,
     'fum': 2,
     'fum_lost': 2,
     'int': 3,
     'pass_td': 2,
     'pass_yds': 52,
     'rec': 4,
     'rec_td': 0,
     'rec_yds': 99,
     'rush_td': 1,
     'rush_yds': 100,
     'two_pt': 0},
    'half', 'QB'],
   {'display': '30.5', 'hundredths': 3050}),
  ('normal control 4',
   [{'first_downs': 5,
     'fum': 1,
     'fum_lost': 0,
     'int': 1,
     'pass_td': 0,
     'pass_yds': 85,
     'rec': 5,
     'rec_td': 0,
     'rec_yds': 19,
     'rush_td': 0,
     'rush_yds': 47,
     'two_pt': 0},
    'half', 'WR'],
   {'display': '9.8', 'hundredths': 975})]]
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 back with -7 rushing yards is charged a whole point although he never lost a full 10 yards.

Score a skill-player stat line in integer hundredths. Passing yards earn 1 point per full 25 yards, rushing and receiving yards 1 point per full 10 yards, each category truncated toward zero separately. Pass TD 4, interception -2, rush/receiving TD 6, fumble lost -2 (fumbles recovered by the own team are free), two-point conversion 2, each first down 0.25. Receptions are worth 0/0.5/1 for std/half/ppr, and a TE earns an extra 0.5 per reception on top. 300+ passing, 100+ rushing and 100+ receiving yards each add a 3 point bonus. The display string rounds to tenths half away from zero and never shows -0.0.

split: open-access


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

N = 1
observations = []
def solve(stats, fmt, pos):
    def unit(y, per):
        q = abs(y) // per
        return q if y >= 0 else -q
    rec_val = {'std': 0, 'half': 50, 'ppr': 100}[fmt]
    if pos == 'TE':
        rec_val += 50
    pts = 0
    pts += unit(stats['pass_yds'], 25) * 100
    pts += stats['pass_td'] * 400
    pts -= stats['int'] * 200
    pts += unit(stats['rush_yds'], 10) * 100
    pts += stats['rush_td'] * 600
    pts += stats['rec'] * rec_val
    pts += unit(stats['rec_yds'], 10) * 100
    pts += stats['rec_td'] * 600
    pts -= stats['fum_lost'] * 200
    pts += stats['two_pt'] * 200
    pts += stats['first_downs'] * 25
    if stats['pass_yds'] > 300:
        pts += 300
    if stats['rush_yds'] >= 100:
        pts += 300
    if stats['rec_yds'] >= 100:
        pts += 300
    t = (abs(pts) + 5) // 10
    sign = '-' if pts < 0 and t else ''
    return {'hundredths': pts, 'display': '%s%d.%d' % (sign, t // 10, t % 10)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: passing bonus threshold',
   [{'first_downs': 8,
     'fum': 2,
     'fum_lost': 2,
     'int': 2,
     'pass_td': 0,
     'pass_yds': 300,
     'rec': 5,
     'rec_td': 0,
     'rec_yds': 112,
     'rush_td': 2,
     'rush_yds': 35,
     'two_pt': 1},
    'half', 'WR'],
   {'display': '42.5', 'hundredths': 4250}),
  ('partial repair probe: passing bonus threshold',
   [{'first_downs': 9,
     'fum': 0,
     'fum_lost': 0,
     'int': 1,
     'pass_td': 4,
     'pass_yds': 300,
     'rec': 9,
     'rec_td': 0,
     'rec_yds': 19,
     'rush_td': 1,
     'rush_yds': -6,
     'two_pt': 0},
    'std', 'WR'],
   {'display': '38.3', 'hundredths': 3825}),
  ('second regression',
   [{'first_downs': 1,
     'fum': 2,
     'fum_lost': 1,
     'int': 2,
     'pass_td': 0,
     'pass_yds': 271,
     'rec': 4,
     'rec_td': 2,
     'rec_yds': 100,
     'rush_td': 2,
     'rush_yds': 100,
     'two_pt': 1},
    'std', 'QB'],
   {'display': '56.3', 'hundredths': 5625}),
  ('normal control 1',
   [{'first_downs': 9,
     'fum': 2,
     'fum_lost': 1,
     'int': 3,
     'pass_td': 0,
     'pass_yds': 33,
     'rec': 0,
     'rec_td': 0,
     'rec_yds': 0,
     'rush_td': 0,
     'rush_yds': -2,
     'two_pt': 0},
    'half', 'TE'],
   {'display': '-4.8', 'hundredths': -475}),
  ('normal control 2',
   [{'first_downs': 8,
     'fum': 0,
     'fum_lost': 0,
     'int': 2,
     'pass_td': 4,
     'pass_yds': 367,
     'rec': 3,
     'rec_td': 1,
     'rec_yds': 105,
     'rush_td': 2,
     'rush_yds': 27,
     'two_pt': 0},
    'std', 'WR'],
   {'display': '64.0', 'hundredths': 6400}),
  ('normal control 3',
   [{'first_downs': 4,
     'fum': 2,
     'fum_lost': 1,
     'int': 1,
     'pass_td': 2,
     'pass_yds': 328,
     'rec': 11,
     'rec_td': 2,
     'rec_yds': 100,
     'rush_td': 0,
     'rush_yds': 104,
     'two_pt': 0},
    'ppr', 'TE'],
   {'display': '75.5', 'hundredths': 7550}),
  ('normal control 4',
   [{'first_downs': 5,
     'fum': 2,
     'fum_lost': 2,
     'int': 0,
     'pass_td': 0,
     'pass_yds': 145,
     'rec': 4,
     'rec_td': 1,
     'rec_yds': 101,
     'rush_td': 2,
     'rush_yds': 66,
     'two_pt': 1},
    'std', 'QB'],
   {'display': '41.3', 'hundredths': 4125})],
 [('regression: passing bonus threshold',
   [{'first_downs': 8,
     'fum': 0,
     'fum_lost': 0,
     'int': 3,
     'pass_td': 4,
     'pass_yds': 300,
     'rec': 4,
     'rec_td': 1,
     'rec_yds': 100,
     'rush_td': 2,
     'rush_yds': 100,
     'two_pt': 0},
    'half', 'QB'],
   {'display': '73.0', 'hundredths': 7300}),
  ('partial repair probe: passing bonus threshold',
   [{'first_downs': 7,
     'fum': 1,
     'fum_lost': 1,
     'int': 3,
     'pass_td': 4,
     'pass_yds': 299,
     'rec': 4,
     'rec_td': 0,
     'rec_yds': 19,
     'rush_td': 1,
     'rush_yds': 127,
     'two_pt': 1},
    'ppr', 'TE'],
   {'display': '50.8', 'hundredths': 5075}),
  ('second regression',
   [{'first_downs': 7,
     'fum': 3,
     'fum_lost': 3,
     'int': 2,
     'pass_td': 0,
     'pass_yds': 261,
     'rec': 7,
     'rec_td': 0,
     'rec_yds': 70,
     'rush_td': 2,
     'rush_yds': 99,
     'two_pt': 0},
    'std', 'TE'],
   {'display': '33.3', 'hundredths': 3325}),
  ('normal control 1',
   [{'first_downs': 4,
     'fum': 3,
     'fum_lost': 2,
     'int': 0,
     'pass_td': 3,
     'pass_yds': 164,
     'rec': 0,
     'rec_td': 1,
     'rec_yds': 12,
     'rush_td': 2,
     'rush_yds': -13,
     'two_pt': 0},
    'std', 'RB'],
   {'display': '33.0', 'hundredths': 3300}),
  ('normal control 2',
   [{'first_downs': 3,
     'fum': 0,
     'fum_lost': 0,
     'int': 2,
     'pass_td': 0,
     'pass_yds': 412,
     'rec': 2,
     'rec_td': 2,
     'rec_yds': 11,
     'rush_td': 2,
     'rush_yds': 56,
     'two_pt': 0},
    'ppr', 'QB'],
   {'display': '47.8', 'hundredths': 4775}),
  ('normal control 3',
   [{'first_downs': 3,
     'fum': 2,
     'fum_lost': 1,
     'int': 3,
     'pass_td': 0,
     'pass_yds': 39,
     'rec': 0,
     'rec_td': 0,
     'rec_yds': 0,
     'rush_td': 0,
     'rush_yds': -14,
     'two_pt': 0},
    'half', 'TE'],
   {'display': '-7.3', 'hundredths': -725}),
  ('normal control 4',
   [{'first_downs': 9,
     'fum': 0,
     'fum_lost': 0,
     'int': 1,
     'pass_td': 4,
     'pass_yds': 316,
     'rec': 8,
     'rec_td': 1,
     'rec_yds': 20,
     'rush_td': 2,
     'rush_yds': 135,
     'two_pt': 0},
    'ppr', 'QB'],
   {'display': '75.3', 'hundredths': 7525})],
 [('regression: passing bonus threshold',
   [{'first_downs': 6,
     'fum': 0,
     'fum_lost': 0,
     'int': 3,
     'pass_td': 3,
     'pass_yds': 300,
     'rec': 10,
     'rec_td': 1,
     'rec_yds': 112,
     'rush_td': 1,
     'rush_yds': 95,
     'two_pt': 0},
    'ppr', 'RB'],
   {'display': '67.5', 'hundredths': 6750}),
  ('partial repair probe: passing bonus threshold',
   [{'first_downs': 1,
     'fum': 3,
     'fum_lost': 2,
     'int': 2,
     'pass_td': 3,
     'pass_yds': 290,
     'rec': 2,
     'rec_td': 1,
     'rec_yds': 79,
     'rush_td': 1,
     'rush_yds': 100,
     'two_pt': 0},
    'half', 'TE'],
   {'display': '49.3', 'hundredths': 4925}),
  ('second regression',
   [{'first_downs': 3,
     'fum': 0,
     'fum_lost': 0,
     'int': 0,
     'pass_td': 2,
     'pass_yds': 248,
     'rec': 2,
     'rec_td': 1,
     'rec_yds': 19,
     'rush_td': 2,
     'rush_yds': 119,
     'two_pt': 1},
    'std', 'WR'],
   {'display': '52.8', 'hundredths': 5275}),
  ('normal control 1',
   [{'first_downs': 3,
     'fum': 1,
     'fum_lost': 0,
     'int': 2,
     'pass_td': 0,
     'pass_yds': 404,
     'rec': 8,
     'rec_td': 1,
     'rec_yds': 20,
     'rush_td': 1,
     'rush_yds': 100,
     'two_pt': 1},
    'half', 'TE'],
   {'display': '52.8', 'hundredths': 5275}),
  ('normal control 2',
   [{'first_downs': 7,
     'fum': 1,
     'fum_lost': 1,
     'int': 1,
     'pass_td': 1,
     'pass_yds': 106,
     'rec': 8,
     'rec_td': 2,
     'rec_yds': 108,
     'rush_td': 2,
     'rush_yds': 21,
     'two_pt': 1},
    'half', 'TE'],
   {'display': '54.8', 'hundredths': 5475}),
  ('normal control 3',
   [{'first_downs': 7,
     'fum': 2,
     'fum_lost': 2,
     'int': 3,
     'pass_td': 0,
     'pass_yds': 22,
     'rec': 0,
     'rec_td': 0,
     'rec_yds': 0,
     'rush_td': 0,
     'rush_yds': 1,
     'two_pt': 0},
    'std', 'TE'],
   {'display': '-8.3', 'hundredths': -825}),
  ('normal control 4',
   [{'first_downs': 5,
     'fum': 3,
     'fum_lost': 2,
     'int': 1,
     'pass_td': 3,
     'pass_yds': 301,
     'rec': 7,
     'rec_td': 1,
     'rec_yds': 127,
     'rush_td': 1,
     'rush_yds': 9,
     'two_pt': 1},
    'std', 'RB'],
   {'display': '51.3', 'hundredths': 5125})],
 [('regression: passing bonus threshold',
   [{'first_downs': 0,
     'fum': 0,
     'fum_lost': 0,
     'int': 2,
     'pass_td': 2,
     'pass_yds': 300,
     'rec': 1,
     'rec_td': 0,
     'rec_yds': 119,
     'rush_td': 2,
     'rush_yds': 10,
     'two_pt': 0},
    'ppr', 'WR'],
   {'display': '47.0', 'hundredths': 4700}),
  ('partial repair probe: passing bonus threshold',
   [{'first_downs': 5,
     'fum': 1,
     'fum_lost': 0,
     'int': 1,
     'pass_td': 1,
     'pass_yds': 208,
     'rec': 5,
     'rec_td': 0,
     'rec_yds': 99,
     'rush_td': 2,
     'rush_yds': 99,
     'two_pt': 1},
    'ppr', 'RB'],
   {'display': '48.3', 'hundredths': 4825}),
  ('second regression',
   [{'first_downs': 9,
     'fum': 3,
     'fum_lost': 3,
     'int': 0,
     'pass_td': 1,
     'pass_yds': 300,
     'rec': 6,
     'rec_td': 2,
     'rec_yds': 131,
     'rush_td': 1,
     'rush_yds': 11,
     'two_pt': 0},
    'std', 'TE'],
   {'display': '53.3', 'hundredths': 5325}),
  ('normal control 1',
   [{'first_downs': 3,
     'fum': 2,
     'fum_lost': 0,
     'int': 1,
     'pass_td': 3,
     'pass_yds': 372,
     'rec': 0,
     'rec_td': 2,
     'rec_yds': 109,
     'rush_td': 0,
     'rush_yds': 9,
     'two_pt': 0},
    'std', 'RB'],
   {'display': '52.8', 'hundredths': 5275}),
  ('normal control 2',
   [{'first_downs': 0,
     'fum': 2,
     'fum_lost': 1,
     'int': 0,
     'pass_td': 1,
     'pass_yds': 318,
     'rec': 4,
     'rec_td': 0,
     'rec_yds': 100,
     'rush_td': 0,
     'rush_yds': -7,
     'two_pt': 0},
    'half', 'RB'],
   {'display': '32.0', 'hundredths': 3200}),
  ('normal control 3',
   [{'first_downs': 7,
     'fum': 2,
     'fum_lost': 0,
     'int': 0,
     'pass_td': 0,
     'pass_yds': 129,
     'rec': 3,
     'rec_td': 2,
     'rec_yds': 99,
     'rush_td': 2,
     'rush_yds': 148,
     'two_pt': 0},
    'ppr', 'RB'],
   {'display': '59.8', 'hundredths': 5975}),
  ('normal control 4',
   [{'first_downs': 2,
     'fum': 2,
     'fum_lost': 1,
     'int': 1,
     'pass_td': 0,
     'pass_yds': 55,
     'rec': 7,
     'rec_td': 2,
     'rec_yds': 20,
     'rush_td': 0,
     'rush_yds': -13,
     'two_pt': 0},
    'ppr', 'TE'],
   {'display': '22.0', 'hundredths': 2200})],
 [('regression: passing bonus threshold',
   [{'first_downs': 4,
     'fum': 1,
     'fum_lost': 0,
     'int': 0,
     'pass_td': 1,
     'pass_yds': 300,
     'rec': 5,
     'rec_td': 1,
     'rec_yds': 99,
     'rush_td': 1,
     'rush_yds': 100,
     'two_pt': 0},
    'std', 'QB'],
   {'display': '54.0', 'hundredths': 5400}),
  ('partial repair probe: passing bonus threshold',
   [{'first_downs': 6,
     'fum': 1,
     'fum_lost': 1,
     'int': 2,
     'pass_td': 0,
     'pass_yds': 183,
     'rec': 2,
     'rec_td': 1,
     'rec_yds': 65,
     'rush_td': 2,
     'rush_yds': 140,
     'two_pt': 0},
    'half', 'QB'],
   {'display': '44.5', 'hundredths': 4450}),
  ('second regression',
   [{'first_downs': 1,
     'fum': 1,
     'fum_lost': 1,
     'int': 3,
     'pass_td': 1,
     'pass_yds': 231,
     'rec': 1,
     'rec_td': 2,
     'rec_yds': 54,
     'rush_td': 1,
     'rush_yds': 72,
     'two_pt': 1},
    'std', 'QB'],
   {'display': '37.3', 'hundredths': 3725}),
  ('normal control 1',
   [{'first_downs': 0,
     'fum': 0,
     'fum_lost': 0,
     'int': 3,
     'pass_td': 2,
     'pass_yds': 193,
     'rec': 10,
     'rec_td': 1,
     'rec_yds': -4,
     'rush_td': 0,
     'rush_yds': 10,
     'two_pt': 1},
    'half', 'WR'],
   {'display': '23.0', 'hundredths': 2300}),
  ('normal control 2',
   [{'first_downs': 1,
     'fum': 1,
     'fum_lost': 1,
     'int': 0,
     'pass_td': 3,
     'pass_yds': 22,
     'rec': 9,
     'rec_td': 1,
     'rec_yds': 144,
     'rush_td': 2,
     'rush_yds': 78,
     'two_pt': 0},
    'ppr', 'QB'],
   {'display': '61.3', 'hundredths': 6125}),
  ('normal control 3',
   [{'first_downs': 4,
     'fum': 0,
     'fum_lost': 0,
     'int': 0,
     'pass_td': 0,
     'pass_yds': 325,
     'rec': 5,
     'rec_td': 2,
     'rec_yds': 56,
     'rush_td': 2,
     'rush_yds': 10,
     'two_pt': 0},
    'half', 'TE'],
   {'display': '52.0', 'hundredths': 5200}),
  ('normal control 4',
   [{'first_downs': 4,
     'fum': 2,
     'fum_lost': 1,
     'int': 0,
     'pass_td': 4,
     'pass_yds': 190,
     'rec': 8,
     'rec_td': 0,
     'rec_yds': 55,
     'rush_td': 2,
     'rush_yds': -10,
     'two_pt': 0},
    'half', 'TE'],
   {'display': '46.0', 'hundredths': 4600})]]
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(stats, fmt, pos):
    def unit(y, per):
        q = abs(y) // per
        return q if y >= 0 else -q
    rec_val = {'std': 0, 'half': 50, 'ppr': 100}[fmt]
    if pos == 'TE':
        rec_val += 50
    pts = 0
    pts += unit(stats['pass_yds'], 25) * 100
    pts += stats['pass_td'] * 400
    pts -= stats['int'] * 200
    pts += unit(stats['rush_yds'], 10) * 100
    pts += stats['rush_td'] * 600
    pts += stats['rec'] * rec_val
    pts += unit(stats['rec_yds'], 10) * 100
    pts += stats['rec_td'] * 600
    pts -= stats['fum_lost'] * 200
    pts += stats['two_pt'] * 200
    pts += stats['first_downs'] * 25
    if stats['pass_yds'] + stats['rush_yds'] >= 300:
        pts += 300
    if stats['rush_yds'] >= 100:
        pts += 300
    if stats['rec_yds'] >= 100:
        pts += 300
    t = (abs(pts) + 5) // 10
    sign = '-' if pts < 0 and t else ''
    return {'hundredths': pts, 'display': '%s%d.%d' % (sign, t // 10, t % 10)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: passing bonus threshold',
   [{'first_downs': 8,
     'fum': 2,
     'fum_lost': 2,
     'int': 2,
     'pass_td': 0,
     'pass_yds': 300,
     'rec': 5,
     'rec_td': 0,
     'rec_yds': 112,
     'rush_td': 2,
     'rush_yds': 35,
     'two_pt': 1},
    'half', 'WR'],
   {'display': '42.5', 'hundredths': 4250}),
  ('partial repair probe: passing bonus threshold',
   [{'first_downs': 9,
     'fum': 0,
     'fum_lost': 0,
     'int': 1,
     'pass_td': 4,
     'pass_yds': 300,
     'rec': 9,
     'rec_td': 0,
     'rec_yds': 19,
     'rush_td': 1,
     'rush_yds': -6,
     'two_pt': 0},
    'std', 'WR'],
   {'display': '38.3', 'hundredths': 3825}),
  ('second regression',
   [{'first_downs': 1,
     'fum': 2,
     'fum_lost': 1,
     'int': 2,
     'pass_td': 0,
     'pass_yds': 271,
     'rec': 4,
     'rec_td': 2,
     'rec_yds': 100,
     'rush_td': 2,
     'rush_yds': 100,
     'two_pt': 1},
    'std', 'QB'],
   {'display': '56.3', 'hundredths': 5625}),
  ('normal control 1',
   [{'first_downs': 9,
     'fum': 2,
     'fum_lost': 1,
     'int': 3,
     'pass_td': 0,
     'pass_yds': 33,
     'rec': 0,
     'rec_td': 0,
     'rec_yds': 0,
     'rush_td': 0,
     'rush_yds': -2,
     'two_pt': 0},
    'half', 'TE'],
   {'display': '-4.8', 'hundredths': -475}),
  ('normal control 2',
   [{'first_downs': 8,
     'fum': 0,
     'fum_lost': 0,
     'int': 2,
     'pass_td': 4,
     'pass_yds': 367,
     'rec': 3,
     'rec_td': 1,
     'rec_yds': 105,
     'rush_td': 2,
     'rush_yds': 27,
     'two_pt': 0},
    'std', 'WR'],
   {'display': '64.0', 'hundredths': 6400}),
  ('normal control 3',
   [{'first_downs': 4,
     'fum': 2,
     'fum_lost': 1,
     'int': 1,
     'pass_td': 2,
     'pass_yds': 328,
     'rec': 11,
     'rec_td': 2,
     'rec_yds': 100,
     'rush_td': 0,
     'rush_yds': 104,
     'two_pt': 0},
    'ppr', 'TE'],
   {'display': '75.5', 'hundredths': 7550}),
  ('normal control 4',
   [{'first_downs': 5,
     'fum': 2,
     'fum_lost': 2,
     'int': 0,
     'pass_td': 0,
     'pass_yds': 145,
     'rec': 4,
     'rec_td': 1,
     'rec_yds': 101,
     'rush_td': 2,
     'rush_yds': 66,
     'two_pt': 1},
    'std', 'QB'],
   {'display': '41.3', 'hundredths': 4125})],
 [('regression: passing bonus threshold',
   [{'first_downs': 8,
     'fum': 0,
     'fum_lost': 0,
     'int': 3,
     'pass_td': 4,
     'pass_yds': 300,
     'rec': 4,
     'rec_td': 1,
     'rec_yds': 100,
     'rush_td': 2,
     'rush_yds': 100,
     'two_pt': 0},
    'half', 'QB'],
   {'display': '73.0', 'hundredths': 7300}),
  ('partial repair probe: passing bonus threshold',
   [{'first_downs': 7,
     'fum': 1,
     'fum_lost': 1,
     'int': 3,
     'pass_td': 4,
     'pass_yds': 299,
     'rec': 4,
     'rec_td': 0,
     'rec_yds': 19,
     'rush_td': 1,
     'rush_yds': 127,
     'two_pt': 1},
    'ppr', 'TE'],
   {'display': '50.8', 'hundredths': 5075}),
  ('second regression',
   [{'first_downs': 7,
     'fum': 3,
     'fum_lost': 3,
     'int': 2,
     'pass_td': 0,
     'pass_yds': 261,
     'rec': 7,
     'rec_td': 0,
     'rec_yds': 70,
     'rush_td': 2,
     'rush_yds': 99,
     'two_pt': 0},
    'std', 'TE'],
   {'display': '33.3', 'hundredths': 3325}),
  ('normal control 1',
   [{'first_downs': 4,
     'fum': 3,
     'fum_lost': 2,
     'int': 0,
     'pass_td': 3,
     'pass_yds': 164,
     'rec': 0,
     'rec_td': 1,
     'rec_yds': 12,
     'rush_td': 2,
     'rush_yds': -13,
     'two_pt': 0},
    'std', 'RB'],
   {'display': '33.0', 'hundredths': 3300}),
  ('normal control 2',
   [{'first_downs': 3,
     'fum': 0,
     'fum_lost': 0,
     'int': 2,
     'pass_td': 0,
     'pass_yds': 412,
     'rec': 2,
     'rec_td': 2,
     'rec_yds': 11,
     'rush_td': 2,
     'rush_yds': 56,
     'two_pt': 0},
    'ppr', 'QB'],
   {'display': '47.8', 'hundredths': 4775}),
  ('normal control 3',
   [{'first_downs': 3,
     'fum': 2,
     'fum_lost': 1,
     'int': 3,
     'pass_td': 0,
     'pass_yds': 39,
     'rec': 0,
     'rec_td': 0,
     'rec_yds': 0,
     'rush_td': 0,
     'rush_yds': -14,
     'two_pt': 0},
    'half', 'TE'],
   {'display': '-7.3', 'hundredths': -725}),
  ('normal control 4',
   [{'first_downs': 9,
     'fum': 0,
     'fum_lost': 0,
     'int': 1,
     'pass_td': 4,
     'pass_yds': 316,
     'rec': 8,
     'rec_td': 1,
     'rec_yds': 20,
     'rush_td': 2,
     'rush_yds': 135,
     'two_pt': 0},
    'ppr', 'QB'],
   {'display': '75.3', 'hundredths': 7525})],
 [('regression: passing bonus threshold',
   [{'first_downs': 6,
     'fum': 0,
     'fum_lost': 0,
     'int': 3,
     'pass_td': 3,
     'pass_yds': 300,
     'rec': 10,
     'rec_td': 1,
     'rec_yds': 112,
     'rush_td': 1,
     'rush_yds': 95,
     'two_pt': 0},
    'ppr', 'RB'],
   {'display': '67.5', 'hundredths': 6750}),
  ('partial repair probe: passing bonus threshold',
   [{'first_downs': 1,
     'fum': 3,
     'fum_lost': 2,
     'int': 2,
     'pass_td': 3,
     'pass_yds': 290,
     'rec': 2,
     'rec_td': 1,
     'rec_yds': 79,
     'rush_td': 1,
     'rush_yds': 100,
     'two_pt': 0},
    'half', 'TE'],
   {'display': '49.3', 'hundredths': 4925}),
  ('second regression',
   [{'first_downs': 3,
     'fum': 0,
     'fum_lost': 0,
     'int': 0,
     'pass_td': 2,
     'pass_yds': 248,
     'rec': 2,
     'rec_td': 1,
     'rec_yds': 19,
     'rush_td': 2,
     'rush_yds': 119,
     'two_pt': 1},
    'std', 'WR'],
   {'display': '52.8', 'hundredths': 5275}),
  ('normal control 1',
   [{'first_downs': 3,
     'fum': 1,
     'fum_lost': 0,
     'int': 2,
     'pass_td': 0,
     'pass_yds': 404,
     'rec': 8,
     'rec_td': 1,
     'rec_yds': 20,
     'rush_td': 1,
     'rush_yds': 100,
     'two_pt': 1},
    'half', 'TE'],
   {'display': '52.8', 'hundredths': 5275}),
  ('normal control 2',
   [{'first_downs': 7,
     'fum': 1,
     'fum_lost': 1,
     'int': 1,
     'pass_td': 1,
     'pass_yds': 106,
     'rec': 8,
     'rec_td': 2,
     'rec_yds': 108,
     'rush_td': 2,
     'rush_yds': 21,
     'two_pt': 1},
    'half', 'TE'],
   {'display': '54.8', 'hundredths': 5475}),
  ('normal control 3',
   [{'first_downs': 7,
     'fum': 2,
     'fum_lost': 2,
     'int': 3,
     'pass_td': 0,
     'pass_yds': 22,
     'rec': 0,
     'rec_td': 0,
     'rec_yds': 0,
     'rush_td': 0,
     'rush_yds': 1,
     'two_pt': 0},
    'std', 'TE'],
   {'display': '-8.3', 'hundredths': -825}),
  ('normal control 4',
   [{'first_downs': 5,
     'fum': 3,
     'fum_lost': 2,
     'int': 1,
     'pass_td': 3,
     'pass_yds': 301,
     'rec': 7,
     'rec_td': 1,
     'rec_yds': 127,
     'rush_td': 1,
     'rush_yds': 9,
     'two_pt': 1},
    'std', 'RB'],
   {'display': '51.3', 'hundredths': 5125})],
 [('regression: passing bonus threshold',
   [{'first_downs': 0,
     'fum': 0,
     'fum_lost': 0,
     'int': 2,
     'pass_td': 2,
     'pass_yds': 300,
     'rec': 1,
     'rec_td': 0,
     'rec_yds': 119,
     'rush_td': 2,
     'rush_yds': 10,
     'two_pt': 0},
    'ppr', 'WR'],
   {'display': '47.0', 'hundredths': 4700}),
  ('partial repair probe: passing bonus threshold',
   [{'first_downs': 5,
     'fum': 1,
     'fum_lost': 0,
     'int': 1,
     'pass_td': 1,
     'pass_yds': 208,
     'rec': 5,
     'rec_td': 0,
     'rec_yds': 99,
     'rush_td': 2,
     'rush_yds': 99,
     'two_pt': 1},
    'ppr', 'RB'],
   {'display': '48.3', 'hundredths': 4825}),
  ('second regression',
   [{'first_downs': 9,
     'fum': 3,
     'fum_lost': 3,
     'int': 0,
     'pass_td': 1,
     'pass_yds': 300,
     'rec': 6,
     'rec_td': 2,
     'rec_yds': 131,
     'rush_td': 1,
     'rush_yds': 11,
     'two_pt': 0},
    'std', 'TE'],
   {'display': '53.3', 'hundredths': 5325}),
  ('normal control 1',
   [{'first_downs': 3,
     'fum': 2,
     'fum_lost': 0,
     'int': 1,
     'pass_td': 3,
     'pass_yds': 372,
     'rec': 0,
     'rec_td': 2,
     'rec_yds': 109,
     'rush_td': 0,
     'rush_yds': 9,
     'two_pt': 0},
    'std', 'RB'],
   {'display': '52.8', 'hundredths': 5275}),
  ('normal control 2',
   [{'first_downs': 0,
     'fum': 2,
     'fum_lost': 1,
     'int': 0,
     'pass_td': 1,
     'pass_yds': 318,
     'rec': 4,
     'rec_td': 0,
     'rec_yds': 100,
     'rush_td': 0,
     'rush_yds': -7,
     'two_pt': 0},
    'half', 'RB'],
   {'display': '32.0', 'hundredths': 3200}),
  ('normal control 3',
   [{'first_downs': 7,
     'fum': 2,
     'fum_lost': 0,
     'int': 0,
     'pass_td': 0,
     'pass_yds': 129,
     'rec': 3,
     'rec_td': 2,
     'rec_yds': 99,
     'rush_td': 2,
     'rush_yds': 148,
     'two_pt': 0},
    'ppr', 'RB'],
   {'display': '59.8', 'hundredths': 5975}),
  ('normal control 4',
   [{'first_downs': 2,
     'fum': 2,
     'fum_lost': 1,
     'int': 1,
     'pass_td': 0,
     'pass_yds': 55,
     'rec': 7,
     'rec_td': 2,
     'rec_yds': 20,
     'rush_td': 0,
     'rush_yds': -13,
     'two_pt': 0},
    'ppr', 'TE'],
   {'display': '22.0', 'hundredths': 2200})],
 [('regression: passing bonus threshold',
   [{'first_downs': 4,
     'fum': 1,
     'fum_lost': 0,
     'int': 0,
     'pass_td': 1,
     'pass_yds': 300,
     'rec': 5,
     'rec_td': 1,
     'rec_yds': 99,
     'rush_td': 1,
     'rush_yds': 100,
     'two_pt': 0},
    'std', 'QB'],
   {'display': '54.0', 'hundredths': 5400}),
  ('partial repair probe: passing bonus threshold',
   [{'first_downs': 6,
     'fum': 1,
     'fum_lost': 1,
     'int': 2,
     'pass_td': 0,
     'pass_yds': 183,
     'rec': 2,
     'rec_td': 1,
     'rec_yds': 65,
     'rush_td': 2,
     'rush_yds': 140,
     'two_pt': 0},
    'half', 'QB'],
   {'display': '44.5', 'hundredths': 4450}),
  ('second regression',
   [{'first_downs': 1,
     'fum': 1,
     'fum_lost': 1,
     'int': 3,
     'pass_td': 1,
     'pass_yds': 231,
     'rec': 1,
     'rec_td': 2,
     'rec_yds': 54,
     'rush_td': 1,
     'rush_yds': 72,
     'two_pt': 1},
    'std', 'QB'],
   {'display': '37.3', 'hundredths': 3725}),
  ('normal control 1',
   [{'first_downs': 0,
     'fum': 0,
     'fum_lost': 0,
     'int': 3,
     'pass_td': 2,
     'pass_yds': 193,
     'rec': 10,
     'rec_td': 1,
     'rec_yds': -4,
     'rush_td': 0,
     'rush_yds': 10,
     'two_pt': 1},
    'half', 'WR'],
   {'display': '23.0', 'hundredths': 2300}),
  ('normal control 2',
   [{'first_downs': 1,
     'fum': 1,
     'fum_lost': 1,
     'int': 0,
     'pass_td': 3,
     'pass_yds': 22,
     'rec': 9,
     'rec_td': 1,
     'rec_yds': 144,
     'rush_td': 2,
     'rush_yds': 78,
     'two_pt': 0},
    'ppr', 'QB'],
   {'display': '61.3', 'hundredths': 6125}),
  ('normal control 3',
   [{'first_downs': 4,
     'fum': 0,
     'fum_lost': 0,
     'int': 0,
     'pass_td': 0,
     'pass_yds': 325,
     'rec': 5,
     'rec_td': 2,
     'rec_yds': 56,
     'rush_td': 2,
     'rush_yds': 10,
     'two_pt': 0},
    'half', 'TE'],
   {'display': '52.0', 'hundredths': 5200}),
  ('normal control 4',
   [{'first_downs': 4,
     'fum': 2,
     'fum_lost': 1,
     'int': 0,
     'pass_td': 4,
     'pass_yds': 190,
     'rec': 8,
     'rec_td': 0,
     'rec_yds': 55,
     'rush_td': 2,
     'rush_yds': -10,
     'two_pt': 0},
    'half', 'TE'],
   {'display': '46.0', 'hundredths': 4600})]]
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 quarterback finishing on exactly 300 passing yards gets no 3 point bonus.

Score a skill-player stat line in integer hundredths. Passing yards earn 1 point per full 25 yards, rushing and receiving yards 1 point per full 10 yards, each category truncated toward zero separately. Pass TD 4, interception -2, rush/receiving TD 6, fumble lost -2 (fumbles recovered by the own team are free), two-point conversion 2, each first down 0.25. Receptions are worth 0/0.5/1 for std/half/ppr, and a TE earns an extra 0.5 per reception on top. 300+ passing, 100+ rushing and 100+ receiving yards each add a 3 point bonus. The display string rounds to tenths half away from zero and never shows -0.0.

split: open-access