Getting a WA in one test case, can't figure out what edge case I'm missing

Solution: 49391793 | CodeChef

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.