Interesting Couple
시간 제한2초메모리 제한2048 MB
맨해튼 거리를 쓰는 격자 위의 N개 점에서 p(i,j) >= d(i,j)를 만족하는 쌍 (i,j) 중 p(i,j)의 최솟값을 구한다.
문제
You are hosting a party with guests (numbered from to ) in a large room. The party room can be represented as a -dimensional Cartesian space where guest stands at . Since you have a unique personality, you require each guest to only move horizontally or vertically within this room.
The distance between two guests and , denoted as , is the total distance they need to travel in both horizontal and vertical directions to reach each other, i.e., .
The privacy value of two guests and , denoted as , is determined by their distances to the closest other guest. Formally, is the smallest over all where and .
A pair of guest and is an interesting couple if and only if their privacy value is greater or equal to the distance between them. In other words, it is a pair such that .
Your task in this problem is to find the minimum value of among all such interesting couples.
입력
The first line consists of an integer ().
Each of the next lines consists of two integers (). There are no two guests stand at the same location. Formally, for .
Under the given constraints, it can be shown that an interesting couple always exists.
출력
Output an integer representing the minimum value of among all interesting couples.