526 B
526 B
tabsplit: spec
split_cents(total, n) splits a bill of total cents between n payers and
returns the list of each payer's share in cents.
Rules, from the person who owns the bill-splitting feature:
- Exact. The shares sum to
total. Not a cent lost, not a cent invented. - One share per payer. The list has exactly
nentries. - Fair. No two shares differ by more than one cent. Nobody pays 2 cents more than their friend because of rounding.
- Refuses nonsense.
n < 1raisesValueError.