P1452 [Template] Rotating Calipers / [USACO03FALL] Beauty Contest G

Description

Given $n$ points on the plane, find the diameter of the convex hull.

Input Format

The first line contains a positive integer $n$. The next $n$ lines each contain two integers $x, y$, representing the coordinates of a point. All point coordinates are pairwise distinct.

Output Format

Output one line with a single integer, the square of the answer.

Explanation/Hint

### Constraints For $100\%$ of the testdata, $2 \le n \le 5 \times 10^4$, $|x|, |y| \le 10^4$. --- $\text{upd 2022.7.22}$: Four new Hack testdata have been added. Translated by ChatGPT 5