Problem: The city of Kyoto is a famous tourist destination for old temples and shrines.

Ikta came to Kyoto sightseeing with a few friends, but as a result of all acting freely, they all got lost.

So Ikta decided to think about where to meet in order to meet everyone as soon as possible.

Kyoto's roads run innumerably at intervals of 10 from east to west and north to south, and can be regarded as an infinitely wide square grid.

Roads are considered straight and have no width. In addition, the position moved by a distance x to the east and a distance y to the north with respect to the center of the city is represented by the coordinates (x, y).

At the center of the city (0,0), the east-west road and the north-south road intersect.

The figure below illustrates the roads of Kyoto and the coordinates of some points.


<image>


Since the coordinates (Xi, Yi) of N tourists are given as integers, answer the minimum time required for N people to move on the road and gather at one point.

Tourists can move continuously on the road at a speed of 1 distance per hour.

The coordinates of the N tourists given are different, and all coordinates are guaranteed to be on the road.

It is also possible for multiple tourists to exist at one point at the same time, or for tourists to move so that they pass each other.



Input

The input is given in the following format.

> N
> X1 Y1
> ...
> XN YN
>

N in the first line is the number of tourists. The i-th line (1 ≤ i ≤ N) of the next N lines represents the location of the i-th tourist (Xi, Yi). Xi and Yi are given as integers, respectively.

Constraints

Each variable being input satisfies the following constraints.

* 2 ≤ N ≤ 10000
* −108 ≤ Xi, Yi ≤ 108
* When i ≠ j (Xi, Yi) ≠ (Xj, Yj)
* At least one of Xi and Yi is a multiple of 10.

Output

Print the solution to the problem on one line. Allows absolute error up to 10-3.

Examples

Input

3
5 10
-10 0
3 -10


Output

14


Input

2
0 0
0 1


Output

0.5


Input

4
100000000 100000000
100000000 -100000000
-100000000 100000000
-100000000 -100000000


Output

200000000

Solution (in CPP):

Solution:
#include <iostream>
#include <algorithm>
#include <vector>
#include <math.h>
#include <numeric>
#include <queue>
#include <map>
#include <math.h>
using namespace std;
typedef long long int ll;

double dist(double a,double b,double c,double d){
	if(floor(b/10)==floor(d/10)){
		swap(a,b); swap(c,d);
	}
	if(floor(a/10)==floor(c/10)){
		if(b==d)return abs(a-c);
		a-=floor(a/10)*10,c-=floor(c/10)*10;
		return abs(b-d)+min(a+c,20-a-c);
	}
	return abs(a-c)+abs(b-d);
}

int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	int n; cin >> n;
	vector<int> x(n),y(n);
	int xi=1e9,xa=-1e9;
	int yi=1e9,ya=-1e9;
	for(int i=0;i<n;i++){
		cin >> x[i] >> y[i];
		xi=min(xi,x[i]+y[i]);
		xa=max(xa,x[i]+y[i]);
		yi=min(yi,x[i]-y[i]);
		ya=max(ya,x[i]-y[i]);
	}
	double res=1e9;
	xi=(xi+xa)/2,yi=(yi+ya)/2;
	int xx=(xi+yi)/2,yy=(xi-yi)/2;
	xx-=xx%10,yy-=yy%10;
	for(int X=xx-50;X<=xx+50;X+=10){
		for(double Y=yy-50;Y<=yy+50;Y+=0.5){
			double d=0;
			for(int i=0;i<n;i++){
				d=max(d,dist(x[i],y[i],X,Y));
			}
			res=min(res,d);
		}
	}
	for(int Y=yy-30;Y<=yy+30;Y+=10){
		for(double X=xx-30;X<=xx+30;X+=0.5){
			double d=0;
			for(int i=0;i<n;i++){
				d=max(d,dist(x[i],y[i],X,Y));
			}
			res=min(res,d);
		}
	}
	printf("%.9f\n",res);
}