P6415 [COCI 2014/2015 #1] KLOPKA

Description

There are $n$ 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 $n$. The next $n$ lines each contain two integers $x,y$, representing the coordinates of a point.

Output Format

Output one integer: the minimum area of the square.

Explanation/Hint

#### Explanation of Sample Input/Output 1 One possible solution is a square with its upper-right corner at $(7,7)$ and its lower-left corner at $(3,3)$. #### Constraints For $100\%$ of the testdata, it is guaranteed that $2\le n\le 20$ and $1\le x,y\le 100$. #### Notes **The total score for this problem is $80$ points.** This problem is translated from [Croatian Open Competition in Informatics 2014/2015](https://hsin.hr/coci/archive/2014_2015) [Contest #1](https://hsin.hr/coci/archive/2014_2015/contest1_tasks.pdf) T2 KLOPKA。 Translated by ChatGPT 5