#Q16. 「一本通 1.2 练习 2」扩散

「一本通 1.2 练习 2」扩散

Description

A point spreads one unit distance in four directions every unit of time, as shown in the figure: two points aa and bb are considered connected, denoted as e(a,b)e(a,b), if and only if their spreading regions have a common area. The definition of a connected block is that for any two points uu and vv within the block, there must exist a path e(u,a0),e(a0,a1),,e(ak,v)e(u,a_0), e(a_0,a_1),…, e(a_k,v).

Given nn points on a plane, determine the earliest time at which they form a connected block.

Input Format

The first line contains an integer nn, followed by nn lines, each containing the coordinates of a point.

Output Format

Output a single integer representing the earliest time at which all points form a connected block.

Sample 1

2
0 0
5 5

5

Data Range and Hints

For 20%20\% of the data, it is guaranteed that 1n5,1Xi,Yi501 \leq n \leq 5, 1 \leq X_i, Y_i \leq 50;

For 100%100\% of the data, it is guaranteed that 1n50,1Xi,Yi1091 \leq n \leq 50, 1 \leq X_i, Y_i \leq 10^9.