Canadian Computing Competition: 1999 Stage 2, Day 2, Problem 1
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.
Input Specification
The input to the program will consist of a line containing an integer
Output Specification
For each test case, the output from the program is the length of ribbon, to
Sample Input
2
3
-1 1
1 1
1 -1
5
1 0
2 2
2 3
3 1
-1 2
Sample Output
6.83
10.46
Comments
This comment is hidden due to too much negative feedback. Show it anyway.