King Brian is looking at rectangles!
He has a list of
What is the largest possible area he can get from selecting four random points?
Note: axis aligned means that the four lines that form the rectangle are all either horizontal or vertical (aligning with the
Constraints
For all subtasks:
No two points will be the same.
Subtask 1 [15%]
Subtask 2 [70%]
Subtask 3 [15%]
No additional constraints.
Input Specification
The first line will contain the integer
The next
Output Specification
Output one line, the maximum possible area of an axis aligned rectangle King Brian can get from selecting four random points. If no rectangles can be formed, print
Sample Input
9
1 1
5 5
7 7
5 7
7 5
10 10
5 10
10 5
20 20
Sample Output
25
Sample Explanation
There are two possible rectangles that can be constructed with the
- From
to with an area of - From
to with an area of
Thus the answer is
Comments
Negative coordinates are possible. I'm dumb and missed that in the constraints.
from (1,1) to (20,20) with an area of 361 what?
guys, nvm, I get it, we have to have all 4 points in the points list, python3 is a bit hard
your code works in pypy3 (erm oops didn't know u solved it)