"Almost mean" of a set of integer I have three integers $(a, b, c)$ (but this can be generalized to any size). I want to redistribute the sum $a+b+c$ as equally as possible between three variables. In our case, we have three cases:
If $a+b+c=3k$, then the solution is $(k, k, k)$.
If $a+b+c=3k+1$, then the solution is $(k, k, k+1)$.
If $a+b+c=3k+2$, then the solution is $(k+1, k+1, k)$.
Does this notion have a name in mathematics?
Any references?
Thanks.

This really is just the "division algorithm." Let $m$ be the sum you want, and $n$ be the number of variables.
Use the division algorithm to write $m=nq+r$ with $q$ the quotient and $0\leq r<n$ the remainder. Then you can write $m$ as the sum of $r$ instances of $q+1$ and $n-r$ instances of $q$.
