Making the Perimeter of the Convex Hull Shortest

Given n points, find the largest decrease in convex hull perimeter achievable by removing exactly two of the points.

Hard8GeometrySortingBrute forceImplementationNo attempts yetTime limit2sMemory limit512 MB

Problem

The convex hull of a set of three or more points in the plane, when the points do not all lie on a single line, is the convex polygon of smallest area that holds every point of the set on its boundary or inside it.

You are given the positions of the points of a set. Find how much shorter the perimeter of the convex hull becomes when two points are excluded from the set. Exactly two points are excluded, and you choose which two.

The figures below correspond to the three sample cases. The circled points are the ones excluded to produce the shortest convex hull, drawn with thick dashed lines.

Sample 1Sample 2Sample 3

Input

The input consists of a single test case in the following format.

n
x1 y1
.
.
.
xn yn

Here, nn is the number of points in the set, with 5n20005 \le n \le 2000. For each ii, (xi,yi)(x_i, y_i) gives the coordinates of the ii-th point of the set. xix_i and yiy_i are integers between 106-10^6 and 10610^6, inclusive. All the points of the set are distinct, that is, xjxkx_j \ne x_k or yjyky_j \ne y_k holds when jkj \ne k. No single line passes through n2n - 2 or more points of the set.

Output

Let PP be the perimeter of the convex hull of the whole set, and let QQ be the smallest perimeter among the convex hulls of the sets obtained by excluding two points. Print PQP - Q with exactly six digits after the decimal point.