1. The player that receives a new resource gives $max(\frac{1}{n} - penalty\_factor * violation_i + \frac{penalty\_factor * \sum_{i=1}^{n} violation_i}{n}, 0)$ resources to each $player_i$, where:
1. $n$ - the number of all players.
2. $penalty\_factor$ - this can be any number higher than 1.
3. $violation_i$ - how many resources the $player_i$ didn't give to other players and should have given according to the law. It doesn't include the resources that the player has already been penalized for in previous turns.
2. Explanation of the formula:
1. $max(..., 0)$ - the number of resources that the player gives can't be lower than 0. $max$ is a function that returns the higher number. So, that just means that if the result of the expression is lower than 0, then the result should be 0.
2. $\frac{1}{n}$ - we distribute the resource evenly among all players, so each player receives $\frac{1}{n}$ of the resource,
3. $- penalty\_factor * violation$ - we penalize those who don't share resources by not sharing resources with them, proportionally to how much they didn't share,
4. $\frac{penalty\_factor * \sum_{i=1}^{n} violation_i}{n}$ - the resources that we save by not giving the resources to the violators of the law are distributed evenly among all players.