当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

4688:Cut the Cake

题目描述
Mehmet is a nut cake seller. As the whole cake is too large and too heavy, a customer generally buys a specified part of it. The whole cake is a rectangle, while the specified part is a convex polygon region inside the rectangle. To get such specified part, Mehmet uses his sword to cut the cake. The only operation he can do is splitting a piece of cake into two parts by a straight cutting. As the cake is very solid, it cost as much as 1 unit energy to cut each length of cake. What's the minimum energy Mehmet has to consume to satisfy the customer?
输入解释
There are multiple test cases. Process to the End of File.

The first line of each test cases contains three integers 3≤N≤100, 0<W≤5000, 0<H≤5000, where W and H are the width and height of the nut cake. The next N lines are the vertices of the specified part in clockwise or counterclockwise order. Each line contains two integers 0<Xi<W and 0<Yi<H.
输出解释
For each test case, output the minimum energy with six digits after decimal point.
输入样例
4 100 100
10 10
20 10
20 20
10 20
5 40 30
12 25
28 25
32 20
20 8
8 20
输出样例
150.000000
109.494748
来自杭电HDUOJ的附加信息
Author Zejun Wu (watashi)
Recommend zhuyuanchen520

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-4688

最后修改于 2020-10-25T23:15:50+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
5000/5000MS(Java/Others) 102400/102400K(Java/Others)