This page is still under construction.

Parts of this page are still being built. What you see may change.

Cover All Points with Three Squares

Time limit2sMemory limit64 MB

Summary
Find the smallest integer side length d so that three axis-aligned d×d squares can cover all N given points.
Level

Hard8 of 10

Topics
Binary search, Greedy, Geometry, Sorting
Solved
No attempts yet

Problem

Yesterday was real fun.

This morning you wake up and notice that something is just not right. It is not merely a headache; something keeps nagging at you, yet you cannot pin down exactly what it is. You pace around your room, enjoying the sunlight streaming through the open window, and through the holes in the roof... Wait. There were no holes in the roof until today. Definitely.

Suppressing the urge to call your friends and find out where the holes came from, you decide to fix the roof first, in a modern way.

You have decided to nail down 3 equal square boards, with sides parallel to the sides of your (of course, square) roof, to close all the holes, and you wonder what the minimum board size must be.

You are given NN distinct points on the Cartesian plane. Find the minimum dd such that three axis-parallel d×dd \times d squares (they may overlap) can cover all the points (a point lying on the border counts as covered).

Because all coordinates are integers, the answer dd is always an integer. Print dd as an integer.

Input

The first line contains the number of points NN (4≤N≤200 0004 \le N \le 200\,000).

Each of the next NN lines contains two integers xix_i and yiy_i, the coordinates of the ii-th hole (−109≤xi,yi≤109-10^9 \le x_i, y_i \le 10^9). No two points coincide.

Output

Print, on a single line, the minimum integer dd that allows all the points to be covered.

Examples2

  1. Example 1

    Input
    4
    0 1
    0 -1
    1 0
    -1 0
    
    Expected output
    1
    
  2. Example 2

    Input
    12
    0 1
    0 -1
    1 0
    -1 0
    10 1
    10 -1
    11 0
    9 0
    20 1
    20 -1
    21 0
    19 0
    
    Expected output
    2