Recently, Pasha became interested in a chess puzzle. He placed $$$k$$$ kings on a $$$100 \times 100$$$ chessboard. In a single move, a king can be moved to one of the neighboring squares. Two squares are considered neighboring if they share an edge or a corner. If the target square is occupied by another king, the latter is removed from the board. Pasha can choose any king and will continue to move it until he captures another king. What is the minimum number of moves required for Pasha to leave exactly one king remaining on the board?
The first line of the input file contains an integer $$$k$$$ ($$$2 \leq k \leq 100$$$) — the number of kings on the chessboard. The following $$$k$$$ lines each contain two integers $$$r_i$$$ and $$$c_i$$$ — the row and column coordinates of the $$$i^{th}$$$ king, respectively ($$$1 \leq r_i, c_i \leq 100$$$).
The output file should contain a single integer — the minimum number of moves needed for exactly one king to remain on the board.
5 1 1 1 3 3 2 4 1 4 3
6
| Name |
|---|


