#include <stdio.h>
#include <iostream>
#include <algorithm>

using namespace std;

int n;
int minw,maxw;
pair<int,int> z[100000];

bool ok(int d)
{
	int smin = z[0].second;
	int smax = z[0].second;
	int lmin = z[n - 1].second;
	int lmax = z[n - 1].second;
	for(int i = n - 2; i >= 1; i--)
	{
		if(z[i].first <= minw + d)
		{
			break;
		}
		if(z[i].first >= maxw - d)
		{
			if(z[i].second < lmin)
			{
				lmin = z[i].second;
			}
			if(z[i].second > lmax)
			{
				lmax = z[i].second;
			}
			if(lmax - lmin > d)
			{
				return false;
			}
		}
		else
		{
			return false;
		}
	}
	int beg = n - 1;
	for(int i = 1; i < n - 1; i++)
	{
		if(z[i].first < maxw - d)
		{
			if(z[i].second < smin)
			{
				smin = z[i].second;
			}
			if(z[i].second > smax)
			{
				smax = z[i].second;
			}
			if(smax - smin > d)
			{
				return false;
			}
		}
		else
		{
			beg = i;
			break;
		}
	}
	int mmin = 22222;
	int mmax = -22222;
	int end = n - 1;
	for(int i = beg; i < n - 1; i++)
	{
		if(z[i].first > minw + d)
		{
			end = i;
			break;
		}
		if(z[i].second < mmin)
		{
			mmin = z[i].second;
		}
		if(z[i].second > mmax)
		{
			mmax = z[i].second;
		}
	}
	if(beg == end)
	{
		return true;
	}
	bool fir = true;
	if((abs(smin - mmin) > d || abs(smax - mmin) > d) || (abs(lmin - mmax) > d || abs(lmax - mmax) > d))
	{
		fir = false;
	}
	for(int i = beg; i < end; i++)
	{
		bool f1 = false;
		bool f2 = false;
		bool fs = false;
		bool fl = false;
		if(abs(z[i].second - mmin) <= d)
		{
			f1 = true;
		}
		if(abs(z[i].second - mmax) <= d)
		{
			f2 = true;
		}
		if(abs(z[i].second - smin) <= d && abs(z[i].second - smax) <= d)
		{
			fs = true;
		}
		if(abs(z[i].second - lmin) <= d && abs(z[i].second - lmax) <= d)
		{
			fl = true;
		}
		if(f1 && f2)
		{
			if(!fs && !fl)
			{
				return false;
			}
		}
		else if(!f1 && !f2)
		{
			return false;
		}
		else if(f1)
		{
			if(fir)
			{
				 if(!fs)
				 {
					 return false;
				 }
			}
			else
			{
				if(!fl)
				{
					return false;
				}
			}
		}
		else
		{
			if(fir)
			{
				if(!fl)
				{
					return false;
				}
			}
			else
			{
				if(!fs)
				{
					return false;
				}
			}
		}
	}
	return true;
}

int k1[100000];
int k2[100000];

int main()
{
	scanf("%d",&n);
	int max1 = -22222;
	int min1 = 22222;
	int max2 = -22222;
	int min2 = 22222;
	for(int i = 0; i < n; i++)
	{
		int x,y;
		scanf("%d %d",&x,&y);
		int w1 = x + y;
		int w2 = x - y;
		if(w1 > max1)
		{
			max1 = w1;
		}
		if(w1 < min1)
		{
			min1 = w1;
		}
		if(w2 > max2)
		{
			max2 = w2;
		}
		if(w2 < min2)
		{
			min2 = w2;
		}
		k1[i] = w1;
		k2[i] = w2;
	}
	if(max1 - min1 > max2 - min2)
	{
		minw = min1;
		maxw = max1;
		for(int i = 0; i < n; i++)
		{
			z[i] = make_pair(k1[i],k2[i]);
		}
	}
	else
	{
		minw = min2;
		maxw = max2;
		for(int i = 0; i < n; i++)
		{
			z[i] = make_pair(k2[i],k1[i]);
		}
	}
	sort(z,z + n);
	int now = (1 << 20);
	int han = (1 << 19);
	for(int i = 0; i < 20; i++)
	{
		if(ok(now - han))
		{
			now -= han;
		}
		han /= 2;
	}
	printf("%d\n",now);
	return 0;
}
### Prompt

Develop a solution in cpp to the problem described below:

problem

JOI City will hold a large-scale exposition.

There are two themes for this exposition, and each of the N exhibition facilities in JOI City will exhibit on one of the two themes.

The location of the facility is represented by plane coordinates (x, y). To move from the facility at position (x, y) to the facility at (x ′, y ′), | x − x ′ | + It takes only | y − y ′ | (for the integer a, | a | represents the absolute value of a). To create a sense of unity within the same theme, and to be interested in only one theme. In order not to make people feel inconvenience, I would like to assign the theme so that the travel time between two facilities exhibiting on the same theme is as short as possible. Unless the same theme is assigned to all exhibition facilities. , How can you divide the theme.

Let M be the maximum travel time between two facilities exhibiting on the same theme. Create a program to find the minimum value of M given the locations of N exhibition facilities.

output

The output consists of only one line. Output the maximum value M of the maximum travel time between two facilities exhibiting on the same theme.

Input / output example

Input example 1


Five
0 0
Ten
-1 -2
0 1
-1 1

Output example 1


3

In this case, for example, one theme for the facility at coordinates (0, 0), (1, 0), (0, 1), and another theme for the facility at (−1, −2), (−1, 1). When one theme is assigned, the travel time between two facilities exhibiting on the same theme is all 3 or less. Since the travel time cannot be all 2 or less, 3 is output.

The above question sentences and the data used for the automatic referee are the question sentences created and published by the Japan Committee for Information Olympics and the test data for scoring.



input

The first line of input contains the number of facilities N (3 ≤ N ≤ 100000 = 105). The first line of input i + 1 (1 ≤ i ≤ N) represents the coordinates of each facility. The two integers xi, yi (| xi | ≤ 100000 = 105, | yi | ≤ 100000 = 105) are separated by blanks. This is where the coordinates of the i-th facility are (xi, yi). It means that there can be no more than one facility at the same coordinates.

Of the scoring data, 40% of the points are N ≤ 2000.

Example

Input

5
0 0
1 0
-1 -2
0 1
-1 1


Output

3

### Response

```cpp
#include <stdio.h>
#include <iostream>
#include <algorithm>

using namespace std;

int n;
int minw,maxw;
pair<int,int> z[100000];

bool ok(int d)
{
	int smin = z[0].second;
	int smax = z[0].second;
	int lmin = z[n - 1].second;
	int lmax = z[n - 1].second;
	for(int i = n - 2; i >= 1; i--)
	{
		if(z[i].first <= minw + d)
		{
			break;
		}
		if(z[i].first >= maxw - d)
		{
			if(z[i].second < lmin)
			{
				lmin = z[i].second;
			}
			if(z[i].second > lmax)
			{
				lmax = z[i].second;
			}
			if(lmax - lmin > d)
			{
				return false;
			}
		}
		else
		{
			return false;
		}
	}
	int beg = n - 1;
	for(int i = 1; i < n - 1; i++)
	{
		if(z[i].first < maxw - d)
		{
			if(z[i].second < smin)
			{
				smin = z[i].second;
			}
			if(z[i].second > smax)
			{
				smax = z[i].second;
			}
			if(smax - smin > d)
			{
				return false;
			}
		}
		else
		{
			beg = i;
			break;
		}
	}
	int mmin = 22222;
	int mmax = -22222;
	int end = n - 1;
	for(int i = beg; i < n - 1; i++)
	{
		if(z[i].first > minw + d)
		{
			end = i;
			break;
		}
		if(z[i].second < mmin)
		{
			mmin = z[i].second;
		}
		if(z[i].second > mmax)
		{
			mmax = z[i].second;
		}
	}
	if(beg == end)
	{
		return true;
	}
	bool fir = true;
	if((abs(smin - mmin) > d || abs(smax - mmin) > d) || (abs(lmin - mmax) > d || abs(lmax - mmax) > d))
	{
		fir = false;
	}
	for(int i = beg; i < end; i++)
	{
		bool f1 = false;
		bool f2 = false;
		bool fs = false;
		bool fl = false;
		if(abs(z[i].second - mmin) <= d)
		{
			f1 = true;
		}
		if(abs(z[i].second - mmax) <= d)
		{
			f2 = true;
		}
		if(abs(z[i].second - smin) <= d && abs(z[i].second - smax) <= d)
		{
			fs = true;
		}
		if(abs(z[i].second - lmin) <= d && abs(z[i].second - lmax) <= d)
		{
			fl = true;
		}
		if(f1 && f2)
		{
			if(!fs && !fl)
			{
				return false;
			}
		}
		else if(!f1 && !f2)
		{
			return false;
		}
		else if(f1)
		{
			if(fir)
			{
				 if(!fs)
				 {
					 return false;
				 }
			}
			else
			{
				if(!fl)
				{
					return false;
				}
			}
		}
		else
		{
			if(fir)
			{
				if(!fl)
				{
					return false;
				}
			}
			else
			{
				if(!fs)
				{
					return false;
				}
			}
		}
	}
	return true;
}

int k1[100000];
int k2[100000];

int main()
{
	scanf("%d",&n);
	int max1 = -22222;
	int min1 = 22222;
	int max2 = -22222;
	int min2 = 22222;
	for(int i = 0; i < n; i++)
	{
		int x,y;
		scanf("%d %d",&x,&y);
		int w1 = x + y;
		int w2 = x - y;
		if(w1 > max1)
		{
			max1 = w1;
		}
		if(w1 < min1)
		{
			min1 = w1;
		}
		if(w2 > max2)
		{
			max2 = w2;
		}
		if(w2 < min2)
		{
			min2 = w2;
		}
		k1[i] = w1;
		k2[i] = w2;
	}
	if(max1 - min1 > max2 - min2)
	{
		minw = min1;
		maxw = max1;
		for(int i = 0; i < n; i++)
		{
			z[i] = make_pair(k1[i],k2[i]);
		}
	}
	else
	{
		minw = min2;
		maxw = max2;
		for(int i = 0; i < n; i++)
		{
			z[i] = make_pair(k2[i],k1[i]);
		}
	}
	sort(z,z + n);
	int now = (1 << 20);
	int han = (1 << 19);
	for(int i = 0; i < 20; i++)
	{
		if(ok(now - han))
		{
			now -= han;
		}
		han /= 2;
	}
	printf("%d\n",now);
	return 0;
}
```