can anybody explain this problem?It would be good ,if you could use pictorial representation .
💡 Grand Temple 111111111
@gyrsh hey Vibhour
In this question, you are given that there are some watchtowers at different coordinates (x,y). Now 2 rivers flow horizontally and vertically and they intersect at this tower
Here you can see that there are 3 towers at (8,6), (3,8) and (11,2) and for each of them 2 rivers (1 horizontal and the other vertical and flowing and intersecting at the respective (x,y)).
Given this arrangement the rest of the space left in the grid(the white portion in image) is land.
Now the king wants to build a temple and he wants to do that on the largest area available. Now you are required to find out and print the area of the largest land which is available and in which the king can build a temple.
now you are supposed to find the max area, and for having an area you must have a rectangle for that you will need 4 points and for 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. There is one thing you need to keep in mind while calculating the area 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 from (3,2), (3,4), (5,2), (5,4) respectively.