You are given n points on the coordinate plane.
Write a program which calculates the largest possible area of a rectangle such that each of its vertices
is one of the given points. You may assume that such a rectangle exists.
The input is read from standard input. The first line of input contains an integer n, the number of
given points.
Each of the following n lines contains the coordinates of one point, two integers separated by a space.
The coordinates will be between −108 and 108.
No two points will be located at the same coordinates.
4 <= n <= 1,500.
Output should be written to standard output. The first and only line of output should contain a single
integer, the largest possible area of a rectangle.
8 -2 3 -2 -1 0 3 0 -1 1 -1 2 1 -3 1 -2 1
10
Migrated from old NTUJ.
BOI 2009
No. | Testdata Range | Score |
---|