#P6415. [COCI 2014/2015 #1] KLOPKA

[COCI 2014/2015 #1] KLOPKA

Description

There are nn points on the Cartesian plane.

Now you want to enclose all points with a square such that every point lies inside the square or on its boundary. The sides of the square must be parallel to the coordinate axes.

Find the minimum possible area of such a square.

Input Format

The first line contains an integer nn.

The next nn lines each contain two integers x,yx,y, representing the coordinates of a point.

Output Format

Output one integer: the minimum area of the square.

3
3 4
5 7
4 3
16
4
5 1
1 5
10 5
5 10
81

Hint

Explanation of Sample Input/Output 1

One possible solution is a square with its upper-right corner at (7,7)(7,7) and its lower-left corner at (3,3)(3,3).

Constraints

For 100%100\% of the testdata, it is guaranteed that 2n202\le n\le 20 and 1x,y1001\le x,y\le 100.

Notes

The total score for this problem is 8080 points.

This problem is translated from Croatian Open Competition in Informatics 2014/2015 Contest #1 T2 KLOPKA。

Translated by ChatGPT 5