I would like to maximize the function:

$\frac{1}{2}\sum _{i=1}^{N}|{x}_{i}-\frac{1}{N}|$

under the constrains $\sum _{i=1}^{N}{x}_{i}=1$ and $\mathrm{\forall}i\in (1,...,N)$

I have done some test for small values of $N$ and I have the feeling that the solution is $1-\frac{1}{N}$ but I can't figure out how to solve it analytically.

$\frac{1}{2}\sum _{i=1}^{N}|{x}_{i}-\frac{1}{N}|$

under the constrains $\sum _{i=1}^{N}{x}_{i}=1$ and $\mathrm{\forall}i\in (1,...,N)$

I have done some test for small values of $N$ and I have the feeling that the solution is $1-\frac{1}{N}$ but I can't figure out how to solve it analytically.