Roger, having figured out how to reason in two dimensions, has crafted a tricky puzzle for Victor to crack.
Roger has highlighted several lattice points in the
Victor takes a look at this task and scoffs. It's just a line sweep problem, what's so tricky about that?
However, Roger points out to Victor that the rectangle need not be axis-aligned. The rectangles, much like Roger, can be tilted.
Is Victor tilt-proof?
Constraints
For at most 20% of full credit,
All
Input Specification
The first line will contain a single integer,
Each of the next
Output Specification
Print, on a single line, the maximum area of a rectangle with lattice points among the highlighted points. It is guaranteed that a non-degenerate rectangle exists.
Sample Input
8
-2 3
-2 -1
0 3
0 -1
1 -1
2 1
-3 1
-2 1
Sample Output
10
Comments