跳到主要内容
图灵 OJTURING / ONLINE JUDGE

#F1850. Valuable Resources

    ID: 1856 传统题 2000ms 256MiB 尝试: 0 已通过: 0 难度: 3 上传者: 标签>枚举贪心算法思想基础难度共享题库Codeforces英文题面题目来源题面语言

Valuable Resources

题目描述

B. Valuable Resources
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

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 xi and yi− the coordinates of the corresponding mine (-109xi,yi≤109). All points are pairwise distinct.

Output

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

Examples
Input
2
0 0
2 2
Output
4
Input
2
0 0
0 3
Output
9

题目来源:fps-www.educg.net-codeforce-1-2833.xml.zip;FPS 共享题包,题包内第 1421 题。保留原作者与原赛事署名。