Problem Link
Here is my approach:
Suppose for the $$$i$$$th operation the value is $$$y_i$$$ for $$$x_i$$$ coordinate then for every $$$x_j$$$ > $$$x_i$$$ their $$$y$$$ coordinate value gets updated to $$$2y_i-y_j$$$. So, the value for $$$y$$$ gets updated in a fashion $$$2y_1-2y_2+2y_3... - y_0$$$ for $$$x_0$$$. I can't think of a way to implement this alternating sign change pattern. Kindly help.



