Windmill algorithm. Notice that the number of the points on the two side of the line doesn’t change!

I first met this algorithm in the 52. International Mathematical Olympiad. It was explained in the second problem. I couldn’t solve the problem but I liked the idea.

*Related*