Fish nets
Fishing effectively and efficiently can conserve fuel and maximize the catch. Suppose we have a fishing radar that can scan and pinpoint every fish in the seas. Assume that the fish does not move for a while. The fishing net we are using can only be laid out in straight lines. Please compute the minimum total length and the number of the net segments required to surround all the fishes for a catch.
Figure 1: A example configuration. Three net segments are required with a length of 17.0710678119.
Input File Format
The first line of input will contain the number of fishes scanned, followed by the coordinates of the fishes.
Output Format
Print the number of net segments required and the minimum length of the nets (to 10 places).
Sample Input
16
7.0 7.0
7.0 -7.0
-7.0 -7.0
-7.0 7.0
9.0 0.0
-9.0 0.0
0.0 9.0
0.0 -9.0
0.0 0.0
1.0 2.0
-2.0 1.0
-1.0 -1.0
3.0 4.0
4.0 3.0
-5.0 4.0
6.0 5.0
Output for the Sample Input
8 58.2408791142
留言