Paimon just puts distinct points on the plane, one of which is a special point
, and denote the group of remaining points as
.
We call a point set strict convex set, if and only if
and all the points from
lie exactly on the convex hull built from
, with no three points lying on the same line.
You should divide into two sets
and
so that:
Please help Paimon to maximize the sum of the perimeters of these two convex hulls. That is, find a valid division and
which maximizes
, where
means the perimeter of that polygon.
There are multiple test cases. The first line of the input contains an integer
indicating the number of test cases. For each test case:
The first line contains one integerindicating the number of points in
.
For the following n lines, theline contains two integers
and
indicating the location of the
point in
.
It's guaranteed that the points given in the same test case are pairwise different. However, there may be three points lying on the same line.
It's also guaranteed that the sum of n of all test cases will not exceed.
For each test case output one line containing a number indicating the maximum total perimeter. If there does not exist a valid division output "0" (without quotes) instead.
Your answer will be accepted if the relative or absolute error is less than.