D. 严神的 52HZ 舞会 I

内存限制:256 MiB 时间限制:1000 ms 标准输入输出
题目类型:传统 评测方式:文本比较

题目描述

On 5 April 2018, CMSA organized a party called 52Hz dancing party in Hotel ICON. In that party, you can enjoy the western food offered by the hotel and some students may

However, at about 9.30 pm, the electric service broke down and the stage became dark at that moment. Participants are worried but not panic. They moved in the dark and tried to prevent collisions.

One minute later, the electric resumed and the remaining participants in the stage would automatically join a game called 'Find Pairs'.

The closest pair of a boy and a girl will be celebrated by all other participants hoped that they may dance together. You know, only a pair only contains 2 persons with different genders.

Now, the stage can be regarded as a rectangle. There are exact n girls and n boys. The position of each paticipant is expressed by a pair of integers (x, y) . Please find the distance between the closest pair. Here we use Euclidean distance to measure it. In other words, the distance between position (x_1, y_1) and (x_2, y_2) is \sqrt{(x_1 - x_2)^2 + (y_1 - y_2)^2} .

To prevent from floating errors, you only need to output the square of distance.

输入格式

The input contains a single test case.

The first line, a number n , the number of boys and girls.

The following n lines, each line has two integers, indicating the position of boys.

The following n lines, each line has two integers, indicating the position of girls.

输出格式

Output only one line, the square of the distance of the closest pair.

样例

Sample Input

2
1 1
1 2
2 1
2 2

Sample Output

1

数据范围与提示

For 30\% of the data set, n \leq 10^3 .

For 100\% of the data set, 1 \leq n \leq 5 \cdot 10^4, 0 \leq x, y < 2^{31} .