Fish nets


提交答案

分數: 100
時間限制: 75.0s
記憶體限制: 256M

作者:
題目類型
允許的語言
C, C++, Java, Java 11, JAVA 8, Python, ZIG

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

留言

目前沒有評論。