I needed help with the following problem : Problem Link

Solution Link
In the editorial of this problem, it is given that we are adding at the starting and the ending point of the corners (x1, y1) and (x2, y2) whereas decrement the other 2 corners. Could someone please explain the logic behind this?