cho.sh
Notes
Loading...

Running Course

Time limit

2s

Memory limit

256 MB

Problem

The camp has already been running for 12 days. Only half of the camp is over, but the students are already complaining that they are not getting enough exercise.

The teacher decides to hold a running race and take the winner to a nearby convenience store. While looking for a suitable field, the teacher finds a spacious field near the lodging. There are N thin pillars standing in that field.

A running course is a straight segment that starts at one pillar and ends at another pillar. It does not matter if other pillars lie on the course. Since the goal is to make the students run as much as possible, the teacher wants to choose the two pillars that are farthest apart.

Given the coordinates of the N pillars, write a program that outputs the square of the distance between the farthest pair of pillars.

Input

The first line contains the number of pillars N (1 <= N <= 100,000). Each of the next N lines contains two integers, the coordinates of one pillar. The absolute value of every coordinate is at most 50,000.

Output

Print the square of the distance between the two farthest pillars.