Grand temple did not understand the question and not able to code

please explain this question and share the code of the same.

You are provided with the coordinated through which 2 rivers flow- one horizontally and the other one is flowing vertically. You have to build a temple provided the condition that the temple must be enclosed with a river on all 4 sides. You are supposed to find the max possible area for the temple.
For every possible area you must have a rectangle which is enclosed by different rivers on each side.

Sample Input

3
1 1
2 4
5 2

We have 3 points through which rivers flow horizontally as well as vertically.
For the given test case we found that (2,2), (2,4), (5,2), (5,4) these are the 4 points which will give us the maximum area. We also need to assume that the width of the river is 1 unit.
So, while calculating the area we need to ignore the area covered by river i.e. the area will be calculated from the edge next to the left edge, the edge above the bottom edge, the topmost edge and the rightmost edge, therefore for the region (2,2) , (2,4) , (5,2) , (5,4) the actual area will be considered to be (3,2), (3,4), (5,2), (5,4) after removal of the area covered by the river. Thus, giving the maximum area as 2 units.

Please try writing the code for this problem now. You can copy your code on online ide (https://ide.codingblocks.com/), save it and share the corresponding link with me here if you need help with it.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.