## Fish nets

View as PDF

Points: 100
Time limit: 75.0s
Memory limit: 256M

Author:
Problem type
Allowed languages
C, C++, Java, Java 11, JAVA 8, Python, ZIG

Fishing eﬀectively and eﬃciently can conserve fuel and maximize the catch. Suppose we have a ﬁshing radar that can scan and pinpoint every ﬁsh in the seas. Assume that the ﬁsh does not move for a while. The ﬁshing 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 ﬁshes for a catch.

Figure 1: A example conﬁguration. Three net segments are required with a length of 17.0710678119.

#### Input File Format

The ﬁrst line of input will contain the number of ﬁshes scanned, followed by the coordinates of the ﬁshes.

#### 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