#P2742. 【模板】二维凸包 / [USACO5.1] 圈奶牛Fencing the Cows
【模板】二维凸包 / [USACO5.1] 圈奶牛Fencing the Cows
Description
Farmer John wants to build a fence to enclose his cows, but his budget is limited. The fence he builds must include all the locations where his cows like to graze. Given the coordinates of these locations, compute the length of the shortest fence that can enclose all these points.
Input Format
The first line contains an integer , the number of grazing sites.
From line to line , each line contains two real numbers. The real numbers on line represent the and coordinates of the -th grazing site.
Output Format
Output one real number, rounded to two decimal places, representing the length of the fence.
4
4 8
4 12
5 9.3
7 8
12.00
Hint
Constraints:
For of the testdata, it is guaranteed that , . There are at most digits after the decimal point.
Translated by ChatGPT 5
京公网安备 11011102002149号