Math Help - Pentagon

1. Pentagon

Suppose to each vertex of a pentagon, we assign a number $x_i$ with $s = \sum x_i >0$. If $x,y,z$ are numbers assigned to three successive vertices and if $y<0$, then replace $(x,y,z)$ with $(x+y, -y, y+z)$. Repeat this as long as $y<0$. Does this algorithm always stop? If it does stop, how many steps are needed? If not, why doesn't it stop? Prove that it stops or does not stop.

2. Can we post solutions if no one has answered it?

3. Yes please post a solution to this nice problem! I thought about it a little bit but I couldn't figure it out.

4. It always stops. You need to find a function of the five vertices that decreases when you perform the operation. One such function is $f(x_1, x_2, x_3, x_4, x_5) = \sum_{i=1}^{5} (x_{i}-x_{i+2})^{2}, \ x_6 = x_1, \ x_7 = x_2$. Suppose $x_4 < 0$. Then we have $f_{new}-f_{old} = 2sx_4 < 0$.