TopCoder

User's AC Ratio

NaN% (0/0)

Submission's AC Ratio

NaN% (0/0)

Tags

Description

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.

Input Format

There are multiple test cases in the input file. For each test case:


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<=1500

Output Format

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.

Sample Input 1

8
-2 3
-2 -1
0 3
0 -1
1 -1
2 1
-3 1
-2 1

8
-2 3
-2 -1
0 3
0 -1
1 -1
2 1
-3 1
-2 1

Sample Output 1

10
10

Hints

Problem Source

Migrated from old NTUJ.

BOI2009

Subtasks

No. Testdata Range Score

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 10000 65536 200