{"abstract":"A round trip is quoted with an expensive RT fare although two cheap one-way fares are open.","category":"Airline fare rule evaluation","checks":11,"contract":"Input {'fares':[[basis, amount, rbd, min AP days, 'OW'|'RT']],'trip','ap_days','rbd_open'}. A fare applies if its AP requirement <= ap_days and its booking class is open. OW trips use OW fares only; RT trips use an RT fare or two of the same OW fare. Pick the lowest total; ties prefer the booking class earlier in 'YBMHQVLKTN'. Return [[bases], total] or 'NO_FARE'.","evaluation_group":"w2-airline-fare-rules-lowest-applicable-fare","failed_approach":"Adding the pair at a single one-way price undercharges the round trip.","family":"w2-airline-fare-rules-lowest-applicable-fare-rt-doubled-ow-missing","id":"FA-66531","implementations":{"attempt":{"sha256":"ce445d7f7c834dce5be68670aa7e3a6ae673cd38d66468f1b2f0000af15c6645","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    ap = x['ap_days']\n    open_ = set(x['rbd_open'])\n    order = 'YBMHQVLKTN'\n    ok = [f for f in x['fares'] if f[3] <= ap and f[2] in open_]\n    opts = []\n    for basis, amt, rbd, minap, kind in ok:\n        if x['trip'] == 'OW' and kind == 'OW':\n            opts.append((amt, order.index(rbd), [basis]))\n        if x['trip'] == 'RT' and kind == 'RT':\n            opts.append((amt, order.index(rbd), [basis]))\n        if x['trip'] == 'RT' and kind == 'OW':\n            opts.append((amt, order.index(rbd), [basis, basis]))\n    if not opts: return 'NO_FARE'\n    opts.sort(key=lambda o: (o[0], o[1]))\n    return [opts[0][2], opts[0][0]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['RT beats doubled OW', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 15, 'rbd_open': ['Y', 'B', 'M', 'H', 'Q', 'V', 'L', 'K', 'T']}, [['VOW7', 'VOW7'], 640]], ['doubled OW beats RT', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'M', 'V', 'H']}, [['VOW7', 'VOW7'], 640]], ['exactly AP days', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['VOW7'], 320]], ['one day short of AP', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 6, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['HOW3'], 390]], ['closed cheap class', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 11, 'rbd_open': ['Y', 'B', 'H']}, [['HOW3'], 390]], ['price tie between classes', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 30, 'rbd_open': ['Y', 'B', 'M', 'K', 'L']}, [['LRT21'], 640]], ['nothing sellable', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 1, 'rbd_open': ['Q', 'L', 'K']}, 'NO_FARE'], ['OW trip ignores RT fares', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 21, 'rbd_open': ['Y', 'Q', 'L', 'K']}, [['YOW'], 900]], ['sampled case 1', {'fares': [['BOW0', 1090, 'B', 3, 'OW'], ['TRT1', 1190, 'T', 7, 'RT'], ['TRT2', 570, 'T', 0, 'RT'], ['MOW3', 1370, 'M', 3, 'OW']], 'trip': 'RT', 'ap_days': 0, 'rbd_open': ['B', 'H', 'K', 'L', 'M', 'N', 'T', 'Y']}, [['TRT2'], 570]], ['sampled case 2', {'fares': [['TRT0', 970, 'T', 0, 'RT'], ['TOW1', 780, 'T', 3, 'OW'], ['LRT2', 800, 'L', 7, 'RT'], ['VRT3', 1290, 'V', 14, 'RT'], ['BOW4', 1450, 'B', 21, 'OW']], 'trip': 'OW', 'ap_days': 30, 'rbd_open': ['Y']}, 'NO_FARE'], ['sampled case 3', {'fares': [['KRT0', 550, 'K', 3, 'RT'], ['HRT1', 1290, 'H', 3, 'RT'], ['TOW2', 1300, 'T', 7, 'OW'], ['MOW3', 480, 'M', 21, 'OW']], 'trip': 'OW', 'ap_days': 7, 'rbd_open': ['B', 'H', 'M', 'T', 'Y']}, [['TOW2'], 1300]]], [['RT beats doubled OW', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 16, 'rbd_open': ['Y', 'B', 'M', 'H', 'Q', 'V', 'L', 'K', 'T']}, [['VOW7', 'VOW7'], 640]], ['doubled OW beats RT', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'M', 'V', 'H']}, [['VOW7', 'VOW7'], 640]], ['exactly AP days', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['VOW7'], 320]], ['one day short of AP', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 6, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['HOW3'], 390]], ['closed cheap class', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 12, 'rbd_open': ['Y', 'B', 'H']}, [['HOW3'], 390]], ['price tie between classes', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 30, 'rbd_open': ['Y', 'B', 'M', 'K', 'L']}, [['LRT21'], 640]], ['nothing sellable', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 1, 'rbd_open': ['Q', 'L', 'K']}, 'NO_FARE'], ['OW trip ignores RT fares', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 21, 'rbd_open': ['Y', 'Q', 'L', 'K']}, [['YOW'], 900]], ['sampled case 1', {'fares': [['NOW0', 1290, 'N', 0, 'OW'], ['YRT1', 1250, 'Y', 0, 'RT'], ['LOW2', 190, 'L', 7, 'OW']], 'trip': 'OW', 'ap_days': 7, 'rbd_open': ['K', 'T']}, 'NO_FARE'], ['sampled case 2', {'fares': [['TRT0', 1050, 'T', 3, 'RT'], ['KOW1', 890, 'K', 21, 'OW'], ['TOW2', 1070, 'T', 3, 'OW'], ['HOW3', 880, 'H', 14, 'OW'], ['VOW4', 480, 'V', 0, 'OW']], 'trip': 'RT', 'ap_days': 3, 'rbd_open': ['B', 'H', 'K', 'L', 'N', 'Q', 'V', 'Y']}, [['VOW4', 'VOW4'], 960]], ['sampled case 3', {'fares': [['QOW0', 1370, 'Q', 14, 'OW'], ['HRT1', 320, 'H', 3, 'RT'], ['BOW2', 860, 'B', 21, 'OW'], ['LRT3', 1490, 'L', 3, 'RT'], ['LOW4', 1320, 'L', 0, 'OW']], 'trip': 'RT', 'ap_days': 3, 'rbd_open': ['H', 'K', 'L', 'M', 'N', 'Q', 'T', 'V', 'Y']}, [['HRT1'], 320]]], [['RT beats doubled OW', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 17, 'rbd_open': ['Y', 'B', 'M', 'H', 'Q', 'V', 'L', 'K', 'T']}, [['VOW7', 'VOW7'], 640]], ['doubled OW beats RT', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'M', 'V', 'H']}, [['VOW7', 'VOW7'], 640]], ['exactly AP days', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['VOW7'], 320]], ['one day short of AP', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 6, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['HOW3'], 390]], ['closed cheap class', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 13, 'rbd_open': ['Y', 'B', 'H']}, [['HOW3'], 390]], ['price tie between classes', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 30, 'rbd_open': ['Y', 'B', 'M', 'K', 'L']}, [['LRT21'], 640]], ['nothing sellable', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 1, 'rbd_open': ['Q', 'L', 'K']}, 'NO_FARE'], ['OW trip ignores RT fares', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 21, 'rbd_open': ['Y', 'Q', 'L', 'K']}, [['YOW'], 900]], ['sampled case 1', {'fares': [['KOW0', 1090, 'K', 21, 'OW'], ['YRT1', 1120, 'Y', 14, 'RT'], ['YOW2', 200, 'Y', 14, 'OW'], ['TOW3', 770, 'T', 3, 'OW'], ['QRT4', 600, 'Q', 3, 'RT'], ['MOW5', 360, 'M', 0, 'OW']], 'trip': 'RT', 'ap_days': 7, 'rbd_open': ['K', 'L', 'M', 'Q', 'T']}, [['QRT4'], 600]], ['sampled case 2', {'fares': [['QOW0', 280, 'Q', 21, 'OW'], ['TRT1', 1200, 'T', 3, 'RT'], ['MOW2', 110, 'M', 14, 'OW']], 'trip': 'RT', 'ap_days': 7, 'rbd_open': ['H']}, 'NO_FARE'], ['sampled case 3', {'fares': [['YRT0', 1040, 'Y', 0, 'RT'], ['HRT1', 1310, 'H', 14, 'RT'], ['QRT2', 450, 'Q', 3, 'RT'], ['BOW3', 1430, 'B', 0, 'OW'], ['BRT4', 760, 'B', 3, 'RT']], 'trip': 'OW', 'ap_days': 14, 'rbd_open': ['B', 'H', 'M', 'V', 'Y']}, [['BOW3'], 1430]]], [['RT beats doubled OW', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 18, 'rbd_open': ['Y', 'B', 'M', 'H', 'Q', 'V', 'L', 'K', 'T']}, [['VOW7', 'VOW7'], 640]], ['doubled OW beats RT', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'M', 'V', 'H']}, [['VOW7', 'VOW7'], 640]], ['exactly AP days', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['VOW7'], 320]], ['one day short of AP', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 6, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['HOW3'], 390]], ['closed cheap class', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 14, 'rbd_open': ['Y', 'B', 'H']}, [['HOW3'], 390]], ['price tie between classes', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 30, 'rbd_open': ['Y', 'B', 'M', 'K', 'L']}, [['LRT21'], 640]], ['nothing sellable', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 1, 'rbd_open': ['Q', 'L', 'K']}, 'NO_FARE'], ['OW trip ignores RT fares', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 21, 'rbd_open': ['Y', 'Q', 'L', 'K']}, [['YOW'], 900]], ['sampled case 1', {'fares': [['NRT0', 450, 'N', 21, 'RT'], ['KOW1', 1370, 'K', 21, 'OW'], ['KOW2', 1250, 'K', 21, 'OW'], ['LOW3', 610, 'L', 0, 'OW'], ['NOW4', 1400, 'N', 7, 'OW']], 'trip': 'RT', 'ap_days': 10, 'rbd_open': ['B', 'M', 'N', 'Q', 'V', 'Y']}, [['NOW4', 'NOW4'], 2800]], ['sampled case 2', {'fares': [['BRT0', 1180, 'B', 0, 'RT'], ['LOW1', 850, 'L', 7, 'OW'], ['MRT2', 120, 'M', 3, 'RT']], 'trip': 'RT', 'ap_days': 3, 'rbd_open': ['H', 'M', 'N', 'V', 'Y']}, [['MRT2'], 120]], ['sampled case 3', {'fares': [['NOW0', 1490, 'N', 7, 'OW'], ['QRT1', 590, 'Q', 7, 'RT'], ['KOW2', 580, 'K', 14, 'OW']], 'trip': 'OW', 'ap_days': 3, 'rbd_open': ['H', 'L', 'M', 'N', 'Q', 'T', 'V', 'Y']}, 'NO_FARE']], [['RT beats doubled OW', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 19, 'rbd_open': ['Y', 'B', 'M', 'H', 'Q', 'V', 'L', 'K', 'T']}, [['VOW7', 'VOW7'], 640]], ['doubled OW beats RT', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'M', 'V', 'H']}, [['VOW7', 'VOW7'], 640]], ['exactly AP days', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['VOW7'], 320]], ['one day short of AP', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 6, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['HOW3'], 390]], ['closed cheap class', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 15, 'rbd_open': ['Y', 'B', 'H']}, [['HOW3'], 390]], ['price tie between classes', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 30, 'rbd_open': ['Y', 'B', 'M', 'K', 'L']}, [['LRT21'], 640]], ['nothing sellable', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 1, 'rbd_open': ['Q', 'L', 'K']}, 'NO_FARE'], ['OW trip ignores RT fares', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 21, 'rbd_open': ['Y', 'Q', 'L', 'K']}, [['YOW'], 900]], ['sampled case 1', {'fares': [['KOW0', 390, 'K', 3, 'OW'], ['QOW1', 520, 'Q', 3, 'OW'], ['HRT2', 930, 'H', 0, 'RT'], ['YOW3', 280, 'Y', 14, 'OW']], 'trip': 'RT', 'ap_days': 7, 'rbd_open': ['Q', 'T']}, [['QOW1', 'QOW1'], 1040]], ['sampled case 2', {'fares': [['HOW0', 550, 'H', 14, 'OW'], ['TOW1', 1070, 'T', 3, 'OW'], ['MRT2', 770, 'M', 0, 'RT'], ['BRT3', 290, 'B', 14, 'RT']], 'trip': 'OW', 'ap_days': 10, 'rbd_open': ['B']}, 'NO_FARE'], ['sampled case 3', {'fares': [['KOW0', 800, 'K', 21, 'OW'], ['NOW1', 1390, 'N', 21, 'OW'], ['VOW2', 780, 'V', 21, 'OW'], ['YOW3', 200, 'Y', 0, 'OW']], 'trip': 'RT', 'ap_days': 3, 'rbd_open': ['H', 'L', 'Q', 'V', 'Y']}, [['YOW3', 'YOW3'], 400]]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"413c8771c37b155c782ad3601bb3ae15860ab12df31695151012bfed03e02527","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    ap = x['ap_days']\n    open_ = set(x['rbd_open'])\n    order = 'YBMHQVLKTN'\n    ok = [f for f in x['fares'] if f[3] <= ap and f[2] in open_]\n    opts = []\n    for basis, amt, rbd, minap, kind in ok:\n        if x['trip'] == 'OW' and kind == 'OW':\n            opts.append((amt, order.index(rbd), [basis]))\n        if x['trip'] == 'RT' and kind == 'RT':\n            opts.append((amt, order.index(rbd), [basis]))\n    if not opts: return 'NO_FARE'\n    opts.sort(key=lambda o: (o[0], o[1]))\n    return [opts[0][2], opts[0][0]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['RT beats doubled OW', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 15, 'rbd_open': ['Y', 'B', 'M', 'H', 'Q', 'V', 'L', 'K', 'T']}, [['VOW7', 'VOW7'], 640]], ['doubled OW beats RT', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'M', 'V', 'H']}, [['VOW7', 'VOW7'], 640]], ['exactly AP days', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['VOW7'], 320]], ['one day short of AP', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 6, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['HOW3'], 390]], ['closed cheap class', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 11, 'rbd_open': ['Y', 'B', 'H']}, [['HOW3'], 390]], ['price tie between classes', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 30, 'rbd_open': ['Y', 'B', 'M', 'K', 'L']}, [['LRT21'], 640]], ['nothing sellable', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 1, 'rbd_open': ['Q', 'L', 'K']}, 'NO_FARE'], ['OW trip ignores RT fares', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 21, 'rbd_open': ['Y', 'Q', 'L', 'K']}, [['YOW'], 900]], ['sampled case 1', {'fares': [['BOW0', 1090, 'B', 3, 'OW'], ['TRT1', 1190, 'T', 7, 'RT'], ['TRT2', 570, 'T', 0, 'RT'], ['MOW3', 1370, 'M', 3, 'OW']], 'trip': 'RT', 'ap_days': 0, 'rbd_open': ['B', 'H', 'K', 'L', 'M', 'N', 'T', 'Y']}, [['TRT2'], 570]], ['sampled case 2', {'fares': [['TRT0', 970, 'T', 0, 'RT'], ['TOW1', 780, 'T', 3, 'OW'], ['LRT2', 800, 'L', 7, 'RT'], ['VRT3', 1290, 'V', 14, 'RT'], ['BOW4', 1450, 'B', 21, 'OW']], 'trip': 'OW', 'ap_days': 30, 'rbd_open': ['Y']}, 'NO_FARE'], ['sampled case 3', {'fares': [['KRT0', 550, 'K', 3, 'RT'], ['HRT1', 1290, 'H', 3, 'RT'], ['TOW2', 1300, 'T', 7, 'OW'], ['MOW3', 480, 'M', 21, 'OW']], 'trip': 'OW', 'ap_days': 7, 'rbd_open': ['B', 'H', 'M', 'T', 'Y']}, [['TOW2'], 1300]]], [['RT beats doubled OW', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 16, 'rbd_open': ['Y', 'B', 'M', 'H', 'Q', 'V', 'L', 'K', 'T']}, [['VOW7', 'VOW7'], 640]], ['doubled OW beats RT', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'M', 'V', 'H']}, [['VOW7', 'VOW7'], 640]], ['exactly AP days', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['VOW7'], 320]], ['one day short of AP', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 6, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['HOW3'], 390]], ['closed cheap class', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 12, 'rbd_open': ['Y', 'B', 'H']}, [['HOW3'], 390]], ['price tie between classes', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 30, 'rbd_open': ['Y', 'B', 'M', 'K', 'L']}, [['LRT21'], 640]], ['nothing sellable', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 1, 'rbd_open': ['Q', 'L', 'K']}, 'NO_FARE'], ['OW trip ignores RT fares', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 21, 'rbd_open': ['Y', 'Q', 'L', 'K']}, [['YOW'], 900]], ['sampled case 1', {'fares': [['NOW0', 1290, 'N', 0, 'OW'], ['YRT1', 1250, 'Y', 0, 'RT'], ['LOW2', 190, 'L', 7, 'OW']], 'trip': 'OW', 'ap_days': 7, 'rbd_open': ['K', 'T']}, 'NO_FARE'], ['sampled case 2', {'fares': [['TRT0', 1050, 'T', 3, 'RT'], ['KOW1', 890, 'K', 21, 'OW'], ['TOW2', 1070, 'T', 3, 'OW'], ['HOW3', 880, 'H', 14, 'OW'], ['VOW4', 480, 'V', 0, 'OW']], 'trip': 'RT', 'ap_days': 3, 'rbd_open': ['B', 'H', 'K', 'L', 'N', 'Q', 'V', 'Y']}, [['VOW4', 'VOW4'], 960]], ['sampled case 3', {'fares': [['QOW0', 1370, 'Q', 14, 'OW'], ['HRT1', 320, 'H', 3, 'RT'], ['BOW2', 860, 'B', 21, 'OW'], ['LRT3', 1490, 'L', 3, 'RT'], ['LOW4', 1320, 'L', 0, 'OW']], 'trip': 'RT', 'ap_days': 3, 'rbd_open': ['H', 'K', 'L', 'M', 'N', 'Q', 'T', 'V', 'Y']}, [['HRT1'], 320]]], [['RT beats doubled OW', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 17, 'rbd_open': ['Y', 'B', 'M', 'H', 'Q', 'V', 'L', 'K', 'T']}, [['VOW7', 'VOW7'], 640]], ['doubled OW beats RT', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'M', 'V', 'H']}, [['VOW7', 'VOW7'], 640]], ['exactly AP days', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['VOW7'], 320]], ['one day short of AP', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 6, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['HOW3'], 390]], ['closed cheap class', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 13, 'rbd_open': ['Y', 'B', 'H']}, [['HOW3'], 390]], ['price tie between classes', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 30, 'rbd_open': ['Y', 'B', 'M', 'K', 'L']}, [['LRT21'], 640]], ['nothing sellable', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 1, 'rbd_open': ['Q', 'L', 'K']}, 'NO_FARE'], ['OW trip ignores RT fares', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 21, 'rbd_open': ['Y', 'Q', 'L', 'K']}, [['YOW'], 900]], ['sampled case 1', {'fares': [['KOW0', 1090, 'K', 21, 'OW'], ['YRT1', 1120, 'Y', 14, 'RT'], ['YOW2', 200, 'Y', 14, 'OW'], ['TOW3', 770, 'T', 3, 'OW'], ['QRT4', 600, 'Q', 3, 'RT'], ['MOW5', 360, 'M', 0, 'OW']], 'trip': 'RT', 'ap_days': 7, 'rbd_open': ['K', 'L', 'M', 'Q', 'T']}, [['QRT4'], 600]], ['sampled case 2', {'fares': [['QOW0', 280, 'Q', 21, 'OW'], ['TRT1', 1200, 'T', 3, 'RT'], ['MOW2', 110, 'M', 14, 'OW']], 'trip': 'RT', 'ap_days': 7, 'rbd_open': ['H']}, 'NO_FARE'], ['sampled case 3', {'fares': [['YRT0', 1040, 'Y', 0, 'RT'], ['HRT1', 1310, 'H', 14, 'RT'], ['QRT2', 450, 'Q', 3, 'RT'], ['BOW3', 1430, 'B', 0, 'OW'], ['BRT4', 760, 'B', 3, 'RT']], 'trip': 'OW', 'ap_days': 14, 'rbd_open': ['B', 'H', 'M', 'V', 'Y']}, [['BOW3'], 1430]]], [['RT beats doubled OW', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 18, 'rbd_open': ['Y', 'B', 'M', 'H', 'Q', 'V', 'L', 'K', 'T']}, [['VOW7', 'VOW7'], 640]], ['doubled OW beats RT', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'M', 'V', 'H']}, [['VOW7', 'VOW7'], 640]], ['exactly AP days', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['VOW7'], 320]], ['one day short of AP', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 6, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['HOW3'], 390]], ['closed cheap class', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 14, 'rbd_open': ['Y', 'B', 'H']}, [['HOW3'], 390]], ['price tie between classes', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 30, 'rbd_open': ['Y', 'B', 'M', 'K', 'L']}, [['LRT21'], 640]], ['nothing sellable', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 1, 'rbd_open': ['Q', 'L', 'K']}, 'NO_FARE'], ['OW trip ignores RT fares', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 21, 'rbd_open': ['Y', 'Q', 'L', 'K']}, [['YOW'], 900]], ['sampled case 1', {'fares': [['NRT0', 450, 'N', 21, 'RT'], ['KOW1', 1370, 'K', 21, 'OW'], ['KOW2', 1250, 'K', 21, 'OW'], ['LOW3', 610, 'L', 0, 'OW'], ['NOW4', 1400, 'N', 7, 'OW']], 'trip': 'RT', 'ap_days': 10, 'rbd_open': ['B', 'M', 'N', 'Q', 'V', 'Y']}, [['NOW4', 'NOW4'], 2800]], ['sampled case 2', {'fares': [['BRT0', 1180, 'B', 0, 'RT'], ['LOW1', 850, 'L', 7, 'OW'], ['MRT2', 120, 'M', 3, 'RT']], 'trip': 'RT', 'ap_days': 3, 'rbd_open': ['H', 'M', 'N', 'V', 'Y']}, [['MRT2'], 120]], ['sampled case 3', {'fares': [['NOW0', 1490, 'N', 7, 'OW'], ['QRT1', 590, 'Q', 7, 'RT'], ['KOW2', 580, 'K', 14, 'OW']], 'trip': 'OW', 'ap_days': 3, 'rbd_open': ['H', 'L', 'M', 'N', 'Q', 'T', 'V', 'Y']}, 'NO_FARE']], [['RT beats doubled OW', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 19, 'rbd_open': ['Y', 'B', 'M', 'H', 'Q', 'V', 'L', 'K', 'T']}, [['VOW7', 'VOW7'], 640]], ['doubled OW beats RT', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'M', 'V', 'H']}, [['VOW7', 'VOW7'], 640]], ['exactly AP days', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['VOW7'], 320]], ['one day short of AP', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 6, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['HOW3'], 390]], ['closed cheap class', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 15, 'rbd_open': ['Y', 'B', 'H']}, [['HOW3'], 390]], ['price tie between classes', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 30, 'rbd_open': ['Y', 'B', 'M', 'K', 'L']}, [['LRT21'], 640]], ['nothing sellable', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 1, 'rbd_open': ['Q', 'L', 'K']}, 'NO_FARE'], ['OW trip ignores RT fares', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 21, 'rbd_open': ['Y', 'Q', 'L', 'K']}, [['YOW'], 900]], ['sampled case 1', {'fares': [['KOW0', 390, 'K', 3, 'OW'], ['QOW1', 520, 'Q', 3, 'OW'], ['HRT2', 930, 'H', 0, 'RT'], ['YOW3', 280, 'Y', 14, 'OW']], 'trip': 'RT', 'ap_days': 7, 'rbd_open': ['Q', 'T']}, [['QOW1', 'QOW1'], 1040]], ['sampled case 2', {'fares': [['HOW0', 550, 'H', 14, 'OW'], ['TOW1', 1070, 'T', 3, 'OW'], ['MRT2', 770, 'M', 0, 'RT'], ['BRT3', 290, 'B', 14, 'RT']], 'trip': 'OW', 'ap_days': 10, 'rbd_open': ['B']}, 'NO_FARE'], ['sampled case 3', {'fares': [['KOW0', 800, 'K', 21, 'OW'], ['NOW1', 1390, 'N', 21, 'OW'], ['VOW2', 780, 'V', 21, 'OW'], ['YOW3', 200, 'Y', 0, 'OW']], 'trip': 'RT', 'ap_days': 3, 'rbd_open': ['H', 'L', 'Q', 'V', 'Y']}, [['YOW3', 'YOW3'], 400]]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"826c842c1abaae1ffe7db0822e12810e5281bc79ce014928ee47529cb64f4279","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    ap = x['ap_days']\n    open_ = set(x['rbd_open'])\n    order = 'YBMHQVLKTN'\n    ok = [f for f in x['fares'] if f[3] <= ap and f[2] in open_]\n    opts = []\n    for basis, amt, rbd, minap, kind in ok:\n        if x['trip'] == 'OW' and kind == 'OW':\n            opts.append((amt, order.index(rbd), [basis]))\n        if x['trip'] == 'RT' and kind == 'RT':\n            opts.append((amt, order.index(rbd), [basis]))\n        if x['trip'] == 'RT' and kind == 'OW':\n            opts.append((2 * amt, order.index(rbd), [basis, basis]))\n    if not opts: return 'NO_FARE'\n    opts.sort(key=lambda o: (o[0], o[1]))\n    return [opts[0][2], opts[0][0]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['RT beats doubled OW', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 15, 'rbd_open': ['Y', 'B', 'M', 'H', 'Q', 'V', 'L', 'K', 'T']}, [['VOW7', 'VOW7'], 640]], ['doubled OW beats RT', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'M', 'V', 'H']}, [['VOW7', 'VOW7'], 640]], ['exactly AP days', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['VOW7'], 320]], ['one day short of AP', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 6, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['HOW3'], 390]], ['closed cheap class', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 11, 'rbd_open': ['Y', 'B', 'H']}, [['HOW3'], 390]], ['price tie between classes', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 30, 'rbd_open': ['Y', 'B', 'M', 'K', 'L']}, [['LRT21'], 640]], ['nothing sellable', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 1, 'rbd_open': ['Q', 'L', 'K']}, 'NO_FARE'], ['OW trip ignores RT fares', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 21, 'rbd_open': ['Y', 'Q', 'L', 'K']}, [['YOW'], 900]], ['sampled case 1', {'fares': [['BOW0', 1090, 'B', 3, 'OW'], ['TRT1', 1190, 'T', 7, 'RT'], ['TRT2', 570, 'T', 0, 'RT'], ['MOW3', 1370, 'M', 3, 'OW']], 'trip': 'RT', 'ap_days': 0, 'rbd_open': ['B', 'H', 'K', 'L', 'M', 'N', 'T', 'Y']}, [['TRT2'], 570]], ['sampled case 2', {'fares': [['TRT0', 970, 'T', 0, 'RT'], ['TOW1', 780, 'T', 3, 'OW'], ['LRT2', 800, 'L', 7, 'RT'], ['VRT3', 1290, 'V', 14, 'RT'], ['BOW4', 1450, 'B', 21, 'OW']], 'trip': 'OW', 'ap_days': 30, 'rbd_open': ['Y']}, 'NO_FARE'], ['sampled case 3', {'fares': [['KRT0', 550, 'K', 3, 'RT'], ['HRT1', 1290, 'H', 3, 'RT'], ['TOW2', 1300, 'T', 7, 'OW'], ['MOW3', 480, 'M', 21, 'OW']], 'trip': 'OW', 'ap_days': 7, 'rbd_open': ['B', 'H', 'M', 'T', 'Y']}, [['TOW2'], 1300]]], [['RT beats doubled OW', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 16, 'rbd_open': ['Y', 'B', 'M', 'H', 'Q', 'V', 'L', 'K', 'T']}, [['VOW7', 'VOW7'], 640]], ['doubled OW beats RT', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'M', 'V', 'H']}, [['VOW7', 'VOW7'], 640]], ['exactly AP days', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['VOW7'], 320]], ['one day short of AP', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 6, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['HOW3'], 390]], ['closed cheap class', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 12, 'rbd_open': ['Y', 'B', 'H']}, [['HOW3'], 390]], ['price tie between classes', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 30, 'rbd_open': ['Y', 'B', 'M', 'K', 'L']}, [['LRT21'], 640]], ['nothing sellable', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 1, 'rbd_open': ['Q', 'L', 'K']}, 'NO_FARE'], ['OW trip ignores RT fares', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 21, 'rbd_open': ['Y', 'Q', 'L', 'K']}, [['YOW'], 900]], ['sampled case 1', {'fares': [['NOW0', 1290, 'N', 0, 'OW'], ['YRT1', 1250, 'Y', 0, 'RT'], ['LOW2', 190, 'L', 7, 'OW']], 'trip': 'OW', 'ap_days': 7, 'rbd_open': ['K', 'T']}, 'NO_FARE'], ['sampled case 2', {'fares': [['TRT0', 1050, 'T', 3, 'RT'], ['KOW1', 890, 'K', 21, 'OW'], ['TOW2', 1070, 'T', 3, 'OW'], ['HOW3', 880, 'H', 14, 'OW'], ['VOW4', 480, 'V', 0, 'OW']], 'trip': 'RT', 'ap_days': 3, 'rbd_open': ['B', 'H', 'K', 'L', 'N', 'Q', 'V', 'Y']}, [['VOW4', 'VOW4'], 960]], ['sampled case 3', {'fares': [['QOW0', 1370, 'Q', 14, 'OW'], ['HRT1', 320, 'H', 3, 'RT'], ['BOW2', 860, 'B', 21, 'OW'], ['LRT3', 1490, 'L', 3, 'RT'], ['LOW4', 1320, 'L', 0, 'OW']], 'trip': 'RT', 'ap_days': 3, 'rbd_open': ['H', 'K', 'L', 'M', 'N', 'Q', 'T', 'V', 'Y']}, [['HRT1'], 320]]], [['RT beats doubled OW', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 17, 'rbd_open': ['Y', 'B', 'M', 'H', 'Q', 'V', 'L', 'K', 'T']}, [['VOW7', 'VOW7'], 640]], ['doubled OW beats RT', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'M', 'V', 'H']}, [['VOW7', 'VOW7'], 640]], ['exactly AP days', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['VOW7'], 320]], ['one day short of AP', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 6, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['HOW3'], 390]], ['closed cheap class', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 13, 'rbd_open': ['Y', 'B', 'H']}, [['HOW3'], 390]], ['price tie between classes', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 30, 'rbd_open': ['Y', 'B', 'M', 'K', 'L']}, [['LRT21'], 640]], ['nothing sellable', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 1, 'rbd_open': ['Q', 'L', 'K']}, 'NO_FARE'], ['OW trip ignores RT fares', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 21, 'rbd_open': ['Y', 'Q', 'L', 'K']}, [['YOW'], 900]], ['sampled case 1', {'fares': [['KOW0', 1090, 'K', 21, 'OW'], ['YRT1', 1120, 'Y', 14, 'RT'], ['YOW2', 200, 'Y', 14, 'OW'], ['TOW3', 770, 'T', 3, 'OW'], ['QRT4', 600, 'Q', 3, 'RT'], ['MOW5', 360, 'M', 0, 'OW']], 'trip': 'RT', 'ap_days': 7, 'rbd_open': ['K', 'L', 'M', 'Q', 'T']}, [['QRT4'], 600]], ['sampled case 2', {'fares': [['QOW0', 280, 'Q', 21, 'OW'], ['TRT1', 1200, 'T', 3, 'RT'], ['MOW2', 110, 'M', 14, 'OW']], 'trip': 'RT', 'ap_days': 7, 'rbd_open': ['H']}, 'NO_FARE'], ['sampled case 3', {'fares': [['YRT0', 1040, 'Y', 0, 'RT'], ['HRT1', 1310, 'H', 14, 'RT'], ['QRT2', 450, 'Q', 3, 'RT'], ['BOW3', 1430, 'B', 0, 'OW'], ['BRT4', 760, 'B', 3, 'RT']], 'trip': 'OW', 'ap_days': 14, 'rbd_open': ['B', 'H', 'M', 'V', 'Y']}, [['BOW3'], 1430]]], [['RT beats doubled OW', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 18, 'rbd_open': ['Y', 'B', 'M', 'H', 'Q', 'V', 'L', 'K', 'T']}, [['VOW7', 'VOW7'], 640]], ['doubled OW beats RT', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'M', 'V', 'H']}, [['VOW7', 'VOW7'], 640]], ['exactly AP days', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['VOW7'], 320]], ['one day short of AP', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 6, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['HOW3'], 390]], ['closed cheap class', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 14, 'rbd_open': ['Y', 'B', 'H']}, [['HOW3'], 390]], ['price tie between classes', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 30, 'rbd_open': ['Y', 'B', 'M', 'K', 'L']}, [['LRT21'], 640]], ['nothing sellable', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 1, 'rbd_open': ['Q', 'L', 'K']}, 'NO_FARE'], ['OW trip ignores RT fares', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 21, 'rbd_open': ['Y', 'Q', 'L', 'K']}, [['YOW'], 900]], ['sampled case 1', {'fares': [['NRT0', 450, 'N', 21, 'RT'], ['KOW1', 1370, 'K', 21, 'OW'], ['KOW2', 1250, 'K', 21, 'OW'], ['LOW3', 610, 'L', 0, 'OW'], ['NOW4', 1400, 'N', 7, 'OW']], 'trip': 'RT', 'ap_days': 10, 'rbd_open': ['B', 'M', 'N', 'Q', 'V', 'Y']}, [['NOW4', 'NOW4'], 2800]], ['sampled case 2', {'fares': [['BRT0', 1180, 'B', 0, 'RT'], ['LOW1', 850, 'L', 7, 'OW'], ['MRT2', 120, 'M', 3, 'RT']], 'trip': 'RT', 'ap_days': 3, 'rbd_open': ['H', 'M', 'N', 'V', 'Y']}, [['MRT2'], 120]], ['sampled case 3', {'fares': [['NOW0', 1490, 'N', 7, 'OW'], ['QRT1', 590, 'Q', 7, 'RT'], ['KOW2', 580, 'K', 14, 'OW']], 'trip': 'OW', 'ap_days': 3, 'rbd_open': ['H', 'L', 'M', 'N', 'Q', 'T', 'V', 'Y']}, 'NO_FARE']], [['RT beats doubled OW', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 19, 'rbd_open': ['Y', 'B', 'M', 'H', 'Q', 'V', 'L', 'K', 'T']}, [['VOW7', 'VOW7'], 640]], ['doubled OW beats RT', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'M', 'V', 'H']}, [['VOW7', 'VOW7'], 640]], ['exactly AP days', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 7, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['VOW7'], 320]], ['one day short of AP', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 6, 'rbd_open': ['Y', 'B', 'V', 'H']}, [['HOW3'], 390]], ['closed cheap class', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 15, 'rbd_open': ['Y', 'B', 'H']}, [['HOW3'], 390]], ['price tie between classes', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'RT', 'ap_days': 30, 'rbd_open': ['Y', 'B', 'M', 'K', 'L']}, [['LRT21'], 640]], ['nothing sellable', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 1, 'rbd_open': ['Q', 'L', 'K']}, 'NO_FARE'], ['OW trip ignores RT fares', {'fares': [['YOW', 900, 'Y', 0, 'OW'], ['BOW', 610, 'B', 0, 'OW'], ['QRT14', 780, 'Q', 14, 'RT'], ['MRT', 1150, 'M', 0, 'RT'], ['VOW7', 320, 'V', 7, 'OW'], ['LRT21', 640, 'L', 21, 'RT'], ['HOW3', 390, 'H', 3, 'OW'], ['KRT7', 640, 'K', 7, 'RT']], 'trip': 'OW', 'ap_days': 21, 'rbd_open': ['Y', 'Q', 'L', 'K']}, [['YOW'], 900]], ['sampled case 1', {'fares': [['KOW0', 390, 'K', 3, 'OW'], ['QOW1', 520, 'Q', 3, 'OW'], ['HRT2', 930, 'H', 0, 'RT'], ['YOW3', 280, 'Y', 14, 'OW']], 'trip': 'RT', 'ap_days': 7, 'rbd_open': ['Q', 'T']}, [['QOW1', 'QOW1'], 1040]], ['sampled case 2', {'fares': [['HOW0', 550, 'H', 14, 'OW'], ['TOW1', 1070, 'T', 3, 'OW'], ['MRT2', 770, 'M', 0, 'RT'], ['BRT3', 290, 'B', 14, 'RT']], 'trip': 'OW', 'ap_days': 10, 'rbd_open': ['B']}, 'NO_FARE'], ['sampled case 3', {'fares': [['KOW0', 800, 'K', 21, 'OW'], ['NOW1', 1390, 'N', 21, 'OW'], ['VOW2', 780, 'V', 21, 'OW'], ['YOW3', 200, 'Y', 0, 'OW']], 'trip': 'RT', 'ap_days': 3, 'rbd_open': ['H', 'L', 'Q', 'V', 'Y']}, [['YOW3', 'YOW3'], 400]]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"A stipulated toy fare-rule contract with invented constants; it is not an ATPCO or carrier tariff implementation and makes no claim of industry-standard conformance. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-airline-fare-rules-lowest-applicable-fare-rt-doubled-ow-missing","generated_at":"2026-09-29T14:47:44.633750+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Fare shopping filters by rule applicability and inventory, compares round-trip fares against doubled one-way fares, and needs a deterministic tie rule.","repair":"Add two-times-OW candidates for round trips.","root_cause":"The candidate builder omits the doubled one-way option for RT trips.","sha256":"6c578c9bcff0f08ea52dbd0a013ad5164e51ffeaa40c0682aedf183e0ad40699","title":"Round trips never priced as two one-way fares · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.929,"exit_code":1,"observations":[{"actual":[["VOW7","VOW7"],320],"check":"RT beats doubled OW","expected":[["VOW7","VOW7"],640],"passed":false},{"actual":[["VOW7","VOW7"],320],"check":"doubled OW beats RT","expected":[["VOW7","VOW7"],640],"passed":false},{"actual":[["VOW7"],320],"check":"exactly AP days","expected":[["VOW7"],320],"passed":true},{"actual":[["HOW3"],390],"check":"one day short of AP","expected":[["HOW3"],390],"passed":true},{"actual":[["HOW3"],390],"check":"closed cheap class","expected":[["HOW3"],390],"passed":true},{"actual":[["BOW","BOW"],610],"check":"price tie between classes","expected":[["LRT21"],640],"passed":false},{"actual":"NO_FARE","check":"nothing sellable","expected":"NO_FARE","passed":true},{"actual":[["YOW"],900],"check":"OW trip ignores RT fares","expected":[["YOW"],900],"passed":true},{"actual":[["TRT2"],570],"check":"sampled case 1","expected":[["TRT2"],570],"passed":true},{"actual":"NO_FARE","check":"sampled case 2","expected":"NO_FARE","passed":true},{"actual":[["TOW2"],1300],"check":"sampled case 3","expected":[["TOW2"],1300],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"RT beats doubled OW\", \"actual\": [[\"VOW7\", \"VOW7\"], 320], \"expected\": [[\"VOW7\", \"VOW7\"], 640], \"passed\": false}, {\"check\": \"doubled OW beats RT\", \"actual\": [[\"VOW7\", \"VOW7\"], 320], \"expected\": [[\"VOW7\", \"VOW7\"], 640], \"passed\": false}, {\"check\": \"exactly AP days\", \"actual\": [[\"VOW7\"], 320], \"expected\": [[\"VOW7\"], 320], \"passed\": true}, {\"check\": \"one day short of AP\", \"actual\": [[\"HOW3\"], 390], \"expected\": [[\"HOW3\"], 390], \"passed\": true}, {\"check\": \"closed cheap class\", \"actual\": [[\"HOW3\"], 390], \"expected\": [[\"HOW3\"], 390], \"passed\": true}, {\"check\": \"price tie between classes\", \"actual\": [[\"BOW\", \"BOW\"], 610], \"expected\": [[\"LRT21\"], 640], \"passed\": false}, {\"check\": \"nothing sellable\", \"actual\": \"NO_FARE\", \"expected\": \"NO_FARE\", \"passed\": true}, {\"check\": \"OW trip ignores RT fares\", \"actual\": [[\"YOW\"], 900], \"expected\": [[\"YOW\"], 900], \"passed\": true}, {\"check\": \"sampled case 1\", \"actual\": [[\"TRT2\"], 570], \"expected\": [[\"TRT2\"], 570], \"passed\": true}, {\"check\": \"sampled case 2\", \"actual\": \"NO_FARE\", \"expected\": \"NO_FARE\", \"passed\": true}, {\"check\": \"sampled case 3\", \"actual\": [[\"TOW2\"], 1300], \"expected\": [[\"TOW2\"], 1300], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":45.562,"exit_code":1,"observations":[{"actual":[["KRT7"],640],"check":"RT beats doubled OW","expected":[["VOW7","VOW7"],640],"passed":false},{"actual":[["MRT"],1150],"check":"doubled OW beats RT","expected":[["VOW7","VOW7"],640],"passed":false},{"actual":[["VOW7"],320],"check":"exactly AP days","expected":[["VOW7"],320],"passed":true},{"actual":[["HOW3"],390],"check":"one day short of AP","expected":[["HOW3"],390],"passed":true},{"actual":[["HOW3"],390],"check":"closed cheap class","expected":[["HOW3"],390],"passed":true},{"actual":[["LRT21"],640],"check":"price tie between classes","expected":[["LRT21"],640],"passed":true},{"actual":"NO_FARE","check":"nothing sellable","expected":"NO_FARE","passed":true},{"actual":[["YOW"],900],"check":"OW trip ignores RT fares","expected":[["YOW"],900],"passed":true},{"actual":[["TRT2"],570],"check":"sampled case 1","expected":[["TRT2"],570],"passed":true},{"actual":"NO_FARE","check":"sampled case 2","expected":"NO_FARE","passed":true},{"actual":[["TOW2"],1300],"check":"sampled case 3","expected":[["TOW2"],1300],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"RT beats doubled OW\", \"actual\": [[\"KRT7\"], 640], \"expected\": [[\"VOW7\", \"VOW7\"], 640], \"passed\": false}, {\"check\": \"doubled OW beats RT\", \"actual\": [[\"MRT\"], 1150], \"expected\": [[\"VOW7\", \"VOW7\"], 640], \"passed\": false}, {\"check\": \"exactly AP days\", \"actual\": [[\"VOW7\"], 320], \"expected\": [[\"VOW7\"], 320], \"passed\": true}, {\"check\": \"one day short of AP\", \"actual\": [[\"HOW3\"], 390], \"expected\": [[\"HOW3\"], 390], \"passed\": true}, {\"check\": \"closed cheap class\", \"actual\": [[\"HOW3\"], 390], \"expected\": [[\"HOW3\"], 390], \"passed\": true}, {\"check\": \"price tie between classes\", \"actual\": [[\"LRT21\"], 640], \"expected\": [[\"LRT21\"], 640], \"passed\": true}, {\"check\": \"nothing sellable\", \"actual\": \"NO_FARE\", \"expected\": \"NO_FARE\", \"passed\": true}, {\"check\": \"OW trip ignores RT fares\", \"actual\": [[\"YOW\"], 900], \"expected\": [[\"YOW\"], 900], \"passed\": true}, {\"check\": \"sampled case 1\", \"actual\": [[\"TRT2\"], 570], \"expected\": [[\"TRT2\"], 570], \"passed\": true}, {\"check\": \"sampled case 2\", \"actual\": \"NO_FARE\", \"expected\": \"NO_FARE\", \"passed\": true}, {\"check\": \"sampled case 3\", \"actual\": [[\"TOW2\"], 1300], \"expected\": [[\"TOW2\"], 1300], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.471,"exit_code":0,"observations":[{"actual":[["VOW7","VOW7"],640],"check":"RT beats doubled OW","expected":[["VOW7","VOW7"],640],"passed":true},{"actual":[["VOW7","VOW7"],640],"check":"doubled OW beats RT","expected":[["VOW7","VOW7"],640],"passed":true},{"actual":[["VOW7"],320],"check":"exactly AP days","expected":[["VOW7"],320],"passed":true},{"actual":[["HOW3"],390],"check":"one day short of AP","expected":[["HOW3"],390],"passed":true},{"actual":[["HOW3"],390],"check":"closed cheap class","expected":[["HOW3"],390],"passed":true},{"actual":[["LRT21"],640],"check":"price tie between classes","expected":[["LRT21"],640],"passed":true},{"actual":"NO_FARE","check":"nothing sellable","expected":"NO_FARE","passed":true},{"actual":[["YOW"],900],"check":"OW trip ignores RT fares","expected":[["YOW"],900],"passed":true},{"actual":[["TRT2"],570],"check":"sampled case 1","expected":[["TRT2"],570],"passed":true},{"actual":"NO_FARE","check":"sampled case 2","expected":"NO_FARE","passed":true},{"actual":[["TOW2"],1300],"check":"sampled case 3","expected":[["TOW2"],1300],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"RT beats doubled OW\", \"actual\": [[\"VOW7\", \"VOW7\"], 640], \"expected\": [[\"VOW7\", \"VOW7\"], 640], \"passed\": true}, {\"check\": \"doubled OW beats RT\", \"actual\": [[\"VOW7\", \"VOW7\"], 640], \"expected\": [[\"VOW7\", \"VOW7\"], 640], \"passed\": true}, {\"check\": \"exactly AP days\", \"actual\": [[\"VOW7\"], 320], \"expected\": [[\"VOW7\"], 320], \"passed\": true}, {\"check\": \"one day short of AP\", \"actual\": [[\"HOW3\"], 390], \"expected\": [[\"HOW3\"], 390], \"passed\": true}, {\"check\": \"closed cheap class\", \"actual\": [[\"HOW3\"], 390], \"expected\": [[\"HOW3\"], 390], \"passed\": true}, {\"check\": \"price tie between classes\", \"actual\": [[\"LRT21\"], 640], \"expected\": [[\"LRT21\"], 640], \"passed\": true}, {\"check\": \"nothing sellable\", \"actual\": \"NO_FARE\", \"expected\": \"NO_FARE\", \"passed\": true}, {\"check\": \"OW trip ignores RT fares\", \"actual\": [[\"YOW\"], 900], \"expected\": [[\"YOW\"], 900], \"passed\": true}, {\"check\": \"sampled case 1\", \"actual\": [[\"TRT2\"], 570], \"expected\": [[\"TRT2\"], 570], \"passed\": true}, {\"check\": \"sampled case 2\", \"actual\": \"NO_FARE\", \"expected\": \"NO_FARE\", \"passed\": true}, {\"check\": \"sampled case 3\", \"actual\": [[\"TOW2\"], 1300], \"expected\": [[\"TOW2\"], 1300], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}