Enclosing the Grid Points
Time limit5sMemory limit256 MB
Compute the shortest perimeter of a lattice polygon with axis-aligned and diagonal sides that encloses all given grid points strictly inside.
Problem
Peter and Bob play a game on a sheet of graph paper. Peter marks a few grid nodes with points, and Bob draws a polygon around them. Every marked node has to lie strictly inside the polygon, never on its border. Every side of the polygon lies along a side or a diagonal of a grid cell, and the perimeter is as short as possible. Compute that perimeter.
Input
The first line contains the number of points Peter marked, (). Each of the next lines contains two integers and , the coordinates of one point. Each coordinate has absolute value at most . Several points can share the same coordinates.
Output
Print the perimeter of the polygon on one line, rounded to exactly six digits after the decimal point.