Smallest Square 1

Given N points, find the smallest axis-aligned square with integer vertices that strictly contains at least N-2 of the points, and output its area.

Medium7GeometrySortingBrute forceBinary searchNo attempts yetTime limit2sMemory limit512 MB

Problem

There are NN points on the coordinate plane. Find the square of smallest area that satisfies all three conditions below.

  • All four vertices of the square have integer coordinates.
  • All four sides of the square are parallel to the coordinate axes.
  • At least N2N-2 of the given points lie strictly inside the square. A point on the boundary does not count as being inside.

Write a program that prints the smallest area of such a square.

Input

The first line contains the number of points NN. (3N503 \le N \le 50)

Each of the next NN lines contains the coordinates xx and yy of one point, separated by a space. (109x,y109-10^9 \le x, y \le 10^9)

No point is given more than once.

Output

Print the area of the smallest square that satisfies the conditions.