#P1452. 【模板】旋转卡壳 / [USACO03FALL] Beauty Contest G

    ID: 444 远端评测题 1000ms 512MiB 尝试: 0 已通过: 0 难度: 8 上传者: 标签>计算几何2003USACO枚举,暴力凸包旋转卡壳

【模板】旋转卡壳 / [USACO03FALL] Beauty Contest G

Description

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

Input Format

The first line contains a positive integer nn. The next nn lines each contain two integers x,yx, 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.

4
0 0
0 1
1 1
1 0

2

Hint

Constraints

For 100%100\% of the testdata, 2n5×1042 \le n \le 5 \times 10^4, x,y104|x|, |y| \le 10^4.


upd 2022.7.22\text{upd 2022.7.22}: Four new Hack testdata have been added.

Translated by ChatGPT 5