Let integer $n>1$ and $x_1,\cdots, x_n\in\mathbb{R}$ such that $|x_1|+\cdots+|x_n|=1$ and $x_1+\cdots+x_n=0$. Prove that \begin{equation} \left|\frac{x_1}{1}+\frac{x_2}{2}+\cdots+\frac{x_n}{n}\right|\leq \frac{1}{2}\left(1-\frac{1}{n}\right). \end{equation}
I thought of using the triangle inequality, but got stuck halfway. Any hints or tips? Thanks!
Let $I=\{i:x_i>0\}, J=\{j:x_j<0\}$, $S=\sum_{i \in I}x_i, T=\sum_{j \in J}|x_j|$, $A=\sum_{i \in I}\frac{x_i}{i}, B=\sum_{j \in J}\frac{|x_j|}{j}$. Then we have $S=T=\frac{1}{2}$, hence $A \leq \frac{1}{2}$ and $B \geq \frac{1}{2n}$ and the value of the expression is $A-B$ (if $A>B$ as we may assume w.l.o.g).