[ABC330F] 最小包围正方形 (Minimize Bounding Square)
Problem Statement
There are points labeled on the -plane. Point is located at coordinates .
You can perform the following operation between and times, inclusive.
-
First, choose one of the points. Let be the selected point, and assume it is currently at .
-
Next, choose and execute one of the following four actions: Move point along the -axis by . The coordinates of point become .
-
Move point along the -axis by . The coordinates of point become .
-
Move point along the -axis by . The coordinates of point become .
-
Move point along the -axis by . The coordinates of point become .
-
It is allowed to have multiple points at the same coordinates. Note that the input may already have multiple points at the same coordinates.
After all your operations, draw one square that includes all the points inside or on the circumference, with each side parallel to the - or -axis.
Find the minimum possible value for the length of a side of this square. This value can be shown to be an integer since all points are always on lattice points.
In particular, if all points can be made to exist at the same coordinates, the answer is considered to be .
Input
Input is given from Standard Input in the following format:
$N$ $K$
$X_1$ $Y_1$
$X_2$ $Y_2$
$\vdots$
$X_N$ $Y_N$
Output
Print the answer as an integer.
Example
6 5
2 0
5 2
0 3
3 2
3 4
1 5
3
Note
-
Constraints:
-
All input values are integers.
-
-
-
-
Source: ABC330F