Debt avalanche vs snowball schedule to the cent
Exact prompt
# Debt avalanche vs snowball, to the cent `input.json` lists debts and a fixed monthly budget (synthetic). Write `solve.py` (Python 3 standard library only) so that `python solve.py input.json answer.json` simulates both payoff methods month by month. We re-run it on fresh inputs, so do not hard-code anything. ## Input `debts`: list of `{"name", "balance", "apr" (yearly percent, e.g. 21.99), "min_payment"}`; `monthly_budget` (total paid each month, including minimums). ## Rules 1. Work in exact cents (use `decimal.Decimal`; convert input numbers with `Decimal(str(x))`). Round with ROUND_HALF_UP to 0.01. 2. If `monthly_budget` < the sum of all minimum payments, the whole answer is `{"error": "budget_below_minimums"}`. 3. Target order (fixed at the start, using the original balances): **avalanche** = highest apr first, ties by smaller balance, then name; **snowball** = smallest balance first, ties by higher apr, then name. 4. Each month, in this order: (a) every debt with a positive balance gets interest = round(balance * apr / 1200) added to its balance; (b) in input order, each debt with a positive balance is paid min(min_payment, balance) from the budget; (c) whatever is left of the budget goes to debts in target order: pay min(left, balance) to the first target with a positive balance, then any remainder to the next, and so on in the same month. Any budget still left at the end of the month is not used. 5. `payoff_month[name]` = the month number (first month = 1) at whose end the debt's balance is 0. `months` = month at which all are 0. If debts remain after month 600, that method's result is `{"error": "not_paid_off"}`. 6. `total_interest` = all interest added; `total_paid` = all payments. `interest_saved_by_avalanche` = snowball total_interest - avalanche total_interest (only when both methods finish). ## Output `answer.json`: `{"avalanche": R, "snowball": R, "interest_saved_by_avalanche": x}` with R = `{"months", "total_interest", "total_paid", "payoff_month": {name: month}, "order": [names in target order]}`. Money as numbers with 2 decimals. ## Scoring Hidden checks (partial credit = fraction passed; all must pass), money within 0.011, months and orders exact: `orders`, `avalanche_totals`, `snowball_totals`, `payoff_months` (and interest saved) on the given input; `fresh_run_1`, `fresh_run_2` (whole answer on fresh inputs, which can contain 0% debts and equal balances); `budget_below_minimums` (a fresh input whose budget is too small). Each run has a 60-second limit.
Cent rounding of monthly interest, minimums before extra, same-month rollover of leftover money, tie rules for 0% debts and equal balances, and the budget-below-minimums error. Original benchmark task written for usecaserank.com (not based on a specific public post). Headless, offline run on a reproducible fixture. Each run's notes say how its cost was measured (estimates are marked).
These are synthetic test cases for comparing AI models, not financial advice.
Success criteria: 1. orders 2. avalanche_totals 3. snowball_totals 4. payoff_months 5. fresh_run_1 6. fresh_run_2 7. budget_below_minimums
Best model for this task so far: Claude Haiku 5.5 (effort default (no --effort flag) · thinking on) (success, $0.0071, 30s).
All runs (8)
75% pass rate across 8 eligible runs: 6 pass, 1 partial, 1 fail. Partial and failed runs are listed below with everything else.ⓘ
| Model | Cost | Time | Step-insⓘ | Autonomy | Outcome | Trustⓘ | Date | Compare |
|---|---|---|---|---|---|---|---|---|
| QQwen3 Coder 480B Turbo (Venice)thinking on | $0.0077 | 27s | 0 | Fully autonomous | partial | Trust 80% | 2026-11-04 | |
| DDeepSeek V4.1 Flash (Venice)thinking on | $0.01 | 43s | 0 | Fully autonomous | pass | Trust 80% | 2026-10-27 | |
| MMistral Small 3.2 24B Instruct (Venice)thinking on | $0.0061 | 1m | 0 | Fully autonomous | fail | Trust 80% | 2026-10-27 | |
| ZGLM 4.7 (Venice)thinking on | $0.02 | 7m | 0 | Fully autonomous | pass | Trust 80% | 2026-10-23 | |
| OGPT-6.1 Soldefault · thinking on | $0.06 | 43s | 0 | Fully autonomous | pass | Trust 80% | 2026-10-22 | |
| AClaude Haiku 5.5default · thinking on | $0.0071 | 30s | 0 | Fully autonomous | pass | Trust 80% | 2026-10-20 | |
| AClaude Opus 5.5default · thinking on | $0.17 | 50s | 0 | Fully autonomous | pass | Trust 80% | 2026-10-20 | |
| AClaude Sonnet 5.5default · thinking on | $0.06 | 21s | 0 | Fully autonomous | pass | Trust 80% | 2026-10-20 |
Embed this result
A live badge for this use case. It links back here and updates as new runs are published.
Get new runs and ranking changes weekly
Which models got better or cheaper on real tasks like this one.