#P1959. 遗址
遗址
Description
A long time ago, there was a temple. Viewed from above, the temple was a square, built by circular columns erected at its four corners. Now all the columns have fallen, leaving circular marks on the ground. However, there are many such marks on the ground, and experts say the temple must correspond to the largest one.
Write a program that, given the coordinates of the columns, finds the largest square formed by columns (i.e., four points as its vertices), which indicates the temple’s location, and compute its maximum area. Note that the sides of the square are not necessarily parallel to the coordinate axes.
For example, in the figure there are columns. Among them, $(4,2),\allowbreak(5,2),\allowbreak(5,3),\allowbreak(4,3)$ can form a square, and $(1,1),\allowbreak(4,0),\allowbreak(5,3),\allowbreak(2,4)$ can as well. The latter is the largest among them, with area .

Input Format
The first line contains an integer (), the number of columns.
The next lines each contain two space-separated integers, giving the coordinates of a column (each coordinate is in the range to ). All column positions are pairwise distinct.
Output Format
If at least one square exists, output the maximum area; otherwise, output .
10
9 4
4 3
1 1
4 2
2 4
5 8
4 0
5 3
0 5
5 2
10
Hint
Constraints
- : .
- : .
- : .
Translated by ChatGPT 5
京公网安备 11011102002149号