시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB173938855.346%

문제

An Elmira area maple syrup producer was selected as the winner of this year's CCC (Canadian Confectionery Competition) and the judge wants to place a blue ribbon around the sugar bush. To do this, she finds the most northerly tree (if there is more than one most northerly tree, any one will do) and stands at the position of that tree, facing due East. She then turns to the right until she is facing another tree, and walks to that tree in a straight line, measuring the distance. Once again she turns right until she faces a tree, and walks to it. At each step she chooses the tree that involves turning the least angle to the right, continuing until the starting tree is reached. The total distance travelled is the length of ribbon required. Your task is to calculate this length.

입력

The input to the program will consist of a line containing an integer $m$ followed by $m$ data sets. Each data set consists of a line containing an integer $1 < n < 100$, the number of trees in the bush, and this is followed by $n$ lines each with an ordered pair $(x, y)$ of integers which give the location of a tree on the Cartesian grid. You may assume that the $y$-axis points North while the $x$-axis points East.

출력

For each test case, the output from the program is the length of ribbon, to $2$ decimal places, that can enclose every tree.

예제 입력 1

2
3
-1 1
1 1
1 -1
5
1 0
2 2
2 3
3 1
-1 2

예제 출력 1

6.83
10.46