Problem7828--CF102951 - A. Maximum Distance

7828: CF102951 - A. Maximum Distance

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 256 MiB

Description

You are given $N\ (3≤N≤5000)$ integer points on the coordinate plane. 
Find the square of the maximum Euclidean distance (aka length of the straight line) between any two of the points.

Input

The first line contains an integer $N$. 
The second line contains $N$ integers, the $x$-coordinates of the points: $x_1,x_2,…,x_N\ (-1000≤x_i≤1000)$. 
The third line contains $N$ integers, the $y$-coordinates of the points: $y_1,y_2,…,y_N\ (-1000≤yi≤1000)$.

Output

Print one integer, the square of the maximum Euclidean distance between any two of the points.

Sample 1 Input

3
321 -15 -525
404 373 990

Sample 1 Output

1059112

HINT

相同题目:CF102951

Source/Category