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

N = 1
observations = []
def solve(x):
    s = x['face'] + x['arm'] + x['grip']
    lvo = s > 4
    def mins(t):
        h, m = map(int, t.split(':'))
        return h * 60 + m
    elapsed = mins(x['now']) - mins(x['lkw']) + (1440 if x['lkw_yesterday'] else 0)
    if elapsed <= 270:
        path = 'THROMBOLYSIS_WINDOW'
    elif elapsed <= 1440 and lvo:
        path = 'THROMBECTOMY_EVAL'
    else:
        path = 'OUTSIDE_WINDOW'
    dest = 'COMPREHENSIVE' if lvo else 'NEAREST'
    return {'score': s, 'lvo': lvo, 'elapsed_min': elapsed, 'pathway': path, 'destination': dest}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:10', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 10, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '01:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 180,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '01:00', 'now': '05:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:46', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 286, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:10', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1450,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '01:00', 'now': '01:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:20', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 20, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '02:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 240,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '02:00', 'now': '06:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:47', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 287, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:20', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1460,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '02:00', 'now': '02:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:30', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 30, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '03:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 300,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '03:00', 'now': '07:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:48', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 288, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:30', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1470,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '03:00', 'now': '03:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:40', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 40, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '04:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 360,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '04:00', 'now': '08:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:49', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 289, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:40', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1480,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '04:00', 'now': '04:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:50', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 50, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '05:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 420,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '05:00', 'now': '09:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:50', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 290, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:50', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1490,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '05:00', 'now': '05:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})]]
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(x):
    s = x['face'] + x['arm'] + x['grip']
    lvo = s >= 4 and x['face'] == 1
    def mins(t):
        h, m = map(int, t.split(':'))
        return h * 60 + m
    elapsed = mins(x['now']) - mins(x['lkw']) + (1440 if x['lkw_yesterday'] else 0)
    if elapsed <= 270:
        path = 'THROMBOLYSIS_WINDOW'
    elif elapsed <= 1440 and lvo:
        path = 'THROMBECTOMY_EVAL'
    else:
        path = 'OUTSIDE_WINDOW'
    dest = 'COMPREHENSIVE' if lvo else 'NEAREST'
    return {'score': s, 'lvo': lvo, 'elapsed_min': elapsed, 'pathway': path, 'destination': dest}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:10', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 10, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '01:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 180,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '01:00', 'now': '05:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:46', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 286, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:10', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1450,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '01:00', 'now': '01:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:20', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 20, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '02:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 240,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '02:00', 'now': '06:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:47', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 287, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:20', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1460,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '02:00', 'now': '02:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:30', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 30, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '03:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 300,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '03:00', 'now': '07:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:48', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 288, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:30', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1470,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '03:00', 'now': '03:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:40', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 40, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '04:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 360,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '04:00', 'now': '08:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:49', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 289, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:40', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1480,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '04:00', 'now': '04:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:50', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 50, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '05:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 420,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '05:00', 'now': '09:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:50', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 290, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:50', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1490,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '05:00', 'now': '05:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})]]
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 score of 4 is not treated as a suspected large-vessel occlusion.

Input {face 0-1, arm 0-2, grip 0-2, lkw "HH:MM", now "HH:MM", lkw_yesterday}. Score = face+arm+grip; large-vessel suspicion when score >= 4. elapsed = now - lkw in minutes (+1440 if last known well was yesterday). Pathway: elapsed <= 270 THROMBOLYSIS_WINDOW; else elapsed <= 1440 with suspicion THROMBECTOMY_EVAL; else OUTSIDE_WINDOW. Destination COMPREHENSIVE for any large-vessel suspicion, else NEAREST. Return {score, lvo, elapsed_min, pathway, destination}.

split: open-access


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

N = 1
observations = []
def solve(x):
    s = x['face'] + x['arm'] + x['grip']
    lvo = s >= 4
    def mins(t):
        h, m = map(int, t.split(':'))
        return h * 60 + m
    elapsed = mins(x['now']) - mins(x['lkw'])
    if elapsed <= 270:
        path = 'THROMBOLYSIS_WINDOW'
    elif elapsed <= 1440 and lvo:
        path = 'THROMBECTOMY_EVAL'
    else:
        path = 'OUTSIDE_WINDOW'
    dest = 'COMPREHENSIVE' if lvo else 'NEAREST'
    return {'score': s, 'lvo': lvo, 'elapsed_min': elapsed, 'pathway': path, 'destination': dest}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:10', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 10, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '01:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 180,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '01:00', 'now': '05:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:46', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 286, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:10', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1450,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '01:00', 'now': '01:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:20', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 20, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '02:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 240,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '02:00', 'now': '06:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:47', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 287, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:20', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1460,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '02:00', 'now': '02:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:30', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 30, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '03:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 300,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '03:00', 'now': '07:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:48', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 288, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:30', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1470,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '03:00', 'now': '03:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:40', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 40, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '04:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 360,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '04:00', 'now': '08:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:49', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 289, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:40', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1480,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '04:00', 'now': '04:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:50', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 50, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '05:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 420,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '05:00', 'now': '09:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:50', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 290, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:50', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1490,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '05:00', 'now': '05:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

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

N = 1
observations = []
def solve(x):
    s = x['face'] + x['arm'] + x['grip']
    lvo = s >= 4
    def mins(t):
        h, m = map(int, t.split(':'))
        return h * 60 + m
    elapsed = abs(mins(x['now']) - mins(x['lkw']))
    if elapsed <= 270:
        path = 'THROMBOLYSIS_WINDOW'
    elif elapsed <= 1440 and lvo:
        path = 'THROMBECTOMY_EVAL'
    else:
        path = 'OUTSIDE_WINDOW'
    dest = 'COMPREHENSIVE' if lvo else 'NEAREST'
    return {'score': s, 'lvo': lvo, 'elapsed_min': elapsed, 'pathway': path, 'destination': dest}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:10', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 10, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '01:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 180,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '01:00', 'now': '05:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:46', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 286, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:10', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1450,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '01:00', 'now': '01:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:20', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 20, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '02:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 240,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '02:00', 'now': '06:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:47', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 287, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:20', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1460,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '02:00', 'now': '02:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:30', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 30, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '03:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 300,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '03:00', 'now': '07:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:48', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 288, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:30', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1470,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '03:00', 'now': '03:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:40', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 40, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '04:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 360,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '04:00', 'now': '08:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:49', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 289, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:40', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1480,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '04:00', 'now': '04:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:50', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 50, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '05:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 420,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '05:00', 'now': '09:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:50', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 290, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:50', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1490,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '05:00', 'now': '05:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})]]
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 patient last seen well yesterday evening gets a negative elapsed time and a thrombolysis window.

Input {face 0-1, arm 0-2, grip 0-2, lkw "HH:MM", now "HH:MM", lkw_yesterday}. Score = face+arm+grip; large-vessel suspicion when score >= 4. elapsed = now - lkw in minutes (+1440 if last known well was yesterday). Pathway: elapsed <= 270 THROMBOLYSIS_WINDOW; else elapsed <= 1440 with suspicion THROMBECTOMY_EVAL; else OUTSIDE_WINDOW. Destination COMPREHENSIVE for any large-vessel suspicion, else NEAREST. Return {score, lvo, elapsed_min, pathway, destination}.

split: open-access


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

N = 1
observations = []
def solve(x):
    s = x['face'] + x['arm'] + x['grip']
    lvo = s >= 4
    def mins(t):
        h, m = map(int, t.split(':'))
        return h * 60 + m
    elapsed = mins(x['now']) - mins(x['lkw']) + (1440 if x['lkw_yesterday'] else 0)
    if elapsed < 270:
        path = 'THROMBOLYSIS_WINDOW'
    elif elapsed <= 1440 and lvo:
        path = 'THROMBECTOMY_EVAL'
    else:
        path = 'OUTSIDE_WINDOW'
    dest = 'COMPREHENSIVE' if lvo else 'NEAREST'
    return {'score': s, 'lvo': lvo, 'elapsed_min': elapsed, 'pathway': path, 'destination': dest}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:10', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 10, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '01:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 180,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '01:00', 'now': '05:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:46', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 286, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:10', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1450,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '01:00', 'now': '01:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:20', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 20, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '02:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 240,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '02:00', 'now': '06:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:47', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 287, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:20', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1460,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '02:00', 'now': '02:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:30', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 30, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '03:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 300,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '03:00', 'now': '07:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:48', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 288, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:30', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1470,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '03:00', 'now': '03:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:40', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 40, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '04:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 360,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '04:00', 'now': '08:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:49', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 289, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:40', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1480,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '04:00', 'now': '04:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:50', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 50, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '05:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 420,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '05:00', 'now': '09:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:50', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 290, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:50', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1490,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '05:00', 'now': '05:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})]]
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(x):
    s = x['face'] + x['arm'] + x['grip']
    lvo = s >= 4
    def mins(t):
        h, m = map(int, t.split(':'))
        return h * 60 + m
    elapsed = mins(x['now']) - mins(x['lkw']) + (1440 if x['lkw_yesterday'] else 0)
    if elapsed // 60 <= 4:
        path = 'THROMBOLYSIS_WINDOW'
    elif elapsed <= 1440 and lvo:
        path = 'THROMBECTOMY_EVAL'
    else:
        path = 'OUTSIDE_WINDOW'
    dest = 'COMPREHENSIVE' if lvo else 'NEAREST'
    return {'score': s, 'lvo': lvo, 'elapsed_min': elapsed, 'pathway': path, 'destination': dest}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:10', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 10, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '01:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 180,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '01:00', 'now': '05:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:46', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 286, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:10', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1450,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '01:00', 'now': '01:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:20', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 20, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '02:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 240,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '02:00', 'now': '06:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:47', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 287, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:20', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1460,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '02:00', 'now': '02:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:30', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 30, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '03:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 300,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '03:00', 'now': '07:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:48', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 288, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:30', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1470,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '03:00', 'now': '03:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:40', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 40, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '04:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 360,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '04:00', 'now': '08:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:49', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 289, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:40', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1480,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '04:00', 'now': '04:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:50', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 50, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '05:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 420,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '05:00', 'now': '09:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:50', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 290, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:50', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1490,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '05:00', 'now': '05:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})]]
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 patient at exactly 4.5 hours is excluded from thrombolysis.

Input {face 0-1, arm 0-2, grip 0-2, lkw "HH:MM", now "HH:MM", lkw_yesterday}. Score = face+arm+grip; large-vessel suspicion when score >= 4. elapsed = now - lkw in minutes (+1440 if last known well was yesterday). Pathway: elapsed <= 270 THROMBOLYSIS_WINDOW; else elapsed <= 1440 with suspicion THROMBECTOMY_EVAL; else OUTSIDE_WINDOW. Destination COMPREHENSIVE for any large-vessel suspicion, else NEAREST. Return {score, lvo, elapsed_min, pathway, destination}.

split: open-access


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

N = 1
observations = []
def solve(x):
    s = x['face'] + x['arm'] + x['grip']
    lvo = s >= 4
    def mins(t):
        h, m = map(int, t.split(':'))
        return h * 60 + m
    elapsed = mins(x['now']) - mins(x['lkw']) + (1440 if x['lkw_yesterday'] else 0)
    if elapsed <= 270:
        path = 'THROMBOLYSIS_WINDOW'
    elif elapsed < 1440 and lvo:
        path = 'THROMBECTOMY_EVAL'
    else:
        path = 'OUTSIDE_WINDOW'
    dest = 'COMPREHENSIVE' if lvo else 'NEAREST'
    return {'score': s, 'lvo': lvo, 'elapsed_min': elapsed, 'pathway': path, 'destination': dest}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:10', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 10, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '01:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 180,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '01:00', 'now': '05:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:46', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 286, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:10', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1450,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '01:00', 'now': '01:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:20', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 20, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '02:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 240,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '02:00', 'now': '06:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:47', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 287, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:20', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1460,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '02:00', 'now': '02:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:30', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 30, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '03:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 300,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '03:00', 'now': '07:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:48', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 288, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:30', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1470,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '03:00', 'now': '03:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:40', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 40, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '04:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 360,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '04:00', 'now': '08:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:49', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 289, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:40', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1480,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '04:00', 'now': '04:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:50', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 50, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '05:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 420,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '05:00', 'now': '09:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:50', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 290, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:50', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1490,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '05:00', 'now': '05:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})]]
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(x):
    s = x['face'] + x['arm'] + x['grip']
    lvo = s >= 4
    def mins(t):
        h, m = map(int, t.split(':'))
        return h * 60 + m
    elapsed = mins(x['now']) - mins(x['lkw']) + (1440 if x['lkw_yesterday'] else 0)
    if elapsed <= 270:
        path = 'THROMBOLYSIS_WINDOW'
    elif lvo:
        path = 'THROMBECTOMY_EVAL'
    else:
        path = 'OUTSIDE_WINDOW'
    dest = 'COMPREHENSIVE' if lvo else 'NEAREST'
    return {'score': s, 'lvo': lvo, 'elapsed_min': elapsed, 'pathway': path, 'destination': dest}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:10', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 10, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '01:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 180,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '01:00', 'now': '05:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:46', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 286, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:10', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1450,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '01:00', 'now': '01:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:20', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 20, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '02:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 240,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '02:00', 'now': '06:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:47', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 287, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:20', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1460,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '02:00', 'now': '02:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:30', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 30, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '03:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 300,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '03:00', 'now': '07:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:48', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 288, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:30', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1470,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '03:00', 'now': '03:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:40', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 40, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '04:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 360,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '04:00', 'now': '08:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:49', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 289, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:40', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1480,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '04:00', 'now': '04:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})],
 [('mild deficit early',
   {'face': 1, 'arm': 1, 'grip': 0, 'lkw': '10:00', 'now': '10:50', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 50, 'pathway': 'THROMBOLYSIS_WINDOW', 'destination': 'NEAREST'}),
  ('score exactly 4 without facial droop',
   {'face': 0, 'arm': 2, 'grip': 2, 'lkw': '10:00', 'now': '12:00', 'lkw_yesterday': False},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 120,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('last known well yesterday evening',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '22:00', 'now': '05:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 420,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('exactly 4.5 hours',
   {'face': 1, 'arm': 1, 'grip': 1, 'lkw': '05:00', 'now': '09:30', 'lkw_yesterday': False},
   {'score': 3,
    'lvo': False,
    'elapsed_min': 270,
    'pathway': 'THROMBOLYSIS_WINDOW',
    'destination': 'NEAREST'}),
  ('4 hours 50 minutes',
   {'face': 0, 'arm': 1, 'grip': 1, 'lkw': '08:00', 'now': '12:50', 'lkw_yesterday': False},
   {'score': 2, 'lvo': False, 'elapsed_min': 290, 'pathway': 'OUTSIDE_WINDOW', 'destination': 'NEAREST'}),
  ('large vessel at 20 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '14:00', 'now': '10:00', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1200,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel beyond 24 hours',
   {'face': 1, 'arm': 2, 'grip': 2, 'lkw': '08:00', 'now': '08:50', 'lkw_yesterday': True},
   {'score': 5,
    'lvo': True,
    'elapsed_min': 1490,
    'pathway': 'OUTSIDE_WINDOW',
    'destination': 'COMPREHENSIVE'}),
  ('large vessel exactly 24 hours',
   {'face': 1, 'arm': 2, 'grip': 1, 'lkw': '05:00', 'now': '05:00', 'lkw_yesterday': True},
   {'score': 4,
    'lvo': True,
    'elapsed_min': 1440,
    'pathway': 'THROMBECTOMY_EVAL',
    'destination': 'COMPREHENSIVE'})]]
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 large-vessel patient at exactly 24 hours is marked outside the window.

Input {face 0-1, arm 0-2, grip 0-2, lkw "HH:MM", now "HH:MM", lkw_yesterday}. Score = face+arm+grip; large-vessel suspicion when score >= 4. elapsed = now - lkw in minutes (+1440 if last known well was yesterday). Pathway: elapsed <= 270 THROMBOLYSIS_WINDOW; else elapsed <= 1440 with suspicion THROMBECTOMY_EVAL; else OUTSIDE_WINDOW. Destination COMPREHENSIVE for any large-vessel suspicion, else NEAREST. Return {score, lvo, elapsed_min, pathway, destination}.

split: open-access