QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 128 MB Total points: 100

#16348. Counting Rectangles

Statistics

A singer is recently working on their global tour plan. They represent all the cities they are interested in as points on a plane and intend to select 4 cities from them as the locations for this tour. To show that they are unique, they require that there exists a rectangle such that the 4 selected points are exactly the 4 vertices of this rectangle, and they hope to maximize the area of this rectangle. This has made their agent anxious, so they are soliciting solutions from fans worldwide. As a fan, you certainly won't want to miss this opportunity.

Input

The first line of the input contains a positive integer $N$, representing the number of points on the plane (the number of cities the singer is interested in). The following $N$ lines each contain two space-separated integers $X_i$ and $Y_i$, representing the coordinates of the corresponding point.

Output

The output contains only a single non-negative integer, representing the maximum area of the rectangle.

Constraints

  • $20\%$ of the data satisfies $N \le 500$.
  • $100\%$ of the data satisfies $N \le 1500$, $-10^8 \le X_i, Y_i \le 10^8$.
  • The input data guarantees that a solution exists.

Examples

Input 1

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

Output 1

10

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.