split_bill(total_paise, n) dividing an integer amount of paise among n people so shares differ by at most 1 paise and sum exactly to the total — floats would leak money. The first total % n people carry the extra paise.split_bill(1000, 3)
[334, 333, 333]
The remainder paise goes to the first person; the sum is exactly 1000.
divmod(total, n) gives base share and remainder.
First r people get base+1.