When 4 deposits are split by 3 people, the division becomes 1.3333.... which leaves small portion into the contract and make contract balance inconsistent with the actual balance.
The solution would be
Rather than resetting balance = 0 at payout, do balance = balance - payout
Return the remaining to contract owner when the event ends.
When 4 deposits are split by 3 people, the division becomes 1.3333.... which leaves small portion into the contract and make contract balance inconsistent with the actual balance.
The solution would be
balance = 0
at payout, dobalance = balance - payout