I’m sorting the vector of pairs w.r.t. x and adding two end points.
Then using stack technique, calculating the prev and next smallest y coordinates for all points.
After that just calculating the areas from each point and printing the max one.
I’m sorting the vector of pairs w.r.t. x and adding two end points.
Then using stack technique, calculating the prev and next smallest y coordinates for all points.
After that just calculating the areas from each point and printing the max one.