Codeforces Round 276 (Div. 2)
B
Valuable Resources
Codeforces
1300
原题
← AC →
翻译中…

Many computer strategy games require building cities, recruiting army, conquering tribes, collecting resources. Sometimes it leads to interesting problems.

翻译中…

Let's suppose that your task is to build a square city. The world map uses the Cartesian coordinates. The sides of the city should be parallel to coordinate axes. The map contains mines with valuable resources, located at some points with integer coordinates. The sizes of mines are relatively small, i.e. they can be treated as points. The city should be built in such a way that all the mines are inside or on the border of the city square.

翻译中…

Building a city takes large amount of money depending on the size of the city, so you have to build the city with the minimum area. Given the positions of the mines find the minimum possible area of the city.

翻译中…

Input

翻译中…

The first line of the input contains number $*n*$ — the number of mines on the map ($2 ≤ *n* ≤ 1000$). Each of the next $*n*$ lines contains a pair of integers $*x*_{*i*}$ and $*y*_{*i*}$ — the coordinates of the corresponding mine ($- 10^{9} ≤ *x*_{*i*}, *y*_{*i*} ≤ 10^{9}$). All points are pairwise distinct.

翻译中…

Output

翻译中…

Print the minimum area of the city that can cover all the mines with valuable resources.

翻译中…

样例

Input #1
2
0 0
2 2
Output #1
4
InputCopy OutputCopy
Input #2
2
0 0
0 3
Output #2
9
InputCopy OutputCopy
题目信息
题号
485B
时间限制
1 s
内存限制
256 MB
标签
暴力
贪心

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。