Pro.ID10194 TitleFencing the Cows Title链接http://10.20.2.8/oj/exercise/problem?problem_id=10194 AC5 Submit8 Ratio62.50% 时间&空间限制描述Farmer John wishes to build a fence to contain his cows, but he's a bit short on cash right. Any fence he builds must contain all of the favorite grazing spots for his cows. Given the location of these spots, determine the length of the shortest fence which encloses them. 输入The first line of the input file contains one integer, N. N (0 ≤ N ≤ 10,000) is the number of grazing spots that Farmer john wishes to enclose. The next N line consists of two real numbers, Xi and Yi, corresponding to the location of the grazing spots in the plane (-1,000,000 ≤ Xi, Yi ≤ 1,000,000). The numbers will be in decimal format. 输出Description Farmer John wishes to build a fence to contain his cows, but he's a bit short on cash right. Any fence he builds must contain all of the favorite grazing spots for his cows. Given the location of these spots, determine the length of the shortest fence which encloses them. Input The first line of the input file contains one integer, N. N (0 ≤ N ≤ 10,000) is the number of grazing spots that Farmer john wishes to enclose. The next N line consists of two real numbers, Xi and Yi, corresponding to the location of the grazing spots in the plane (-1,000,000 ≤ Xi, Yi ≤ 1,000,000). The numbers will be in decimal format. Output The output should consists of one real number, the length of fence required. The output should be accurate to two decimal places. Sample Input 4 Sample Output 12.00 Source 样例输入4 样例输出12.00 作者 |