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

建议使用的浏览器:

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

4682:The Happy Triangles

题目描述
Alice has a toy, which was made up by two parts. The first part is a frame consisting of one horizontal stick and two vertical sticks. The distance between the two vertical sticks is R. And the horizontal stick is long enough. The second part of her toy is N triangles. These triangles can be fastened on the frame with one of their edges on the horizontal stick. Once they are fastened, they can slide along the horizontal stick. And magically, they can overlap each other. (See pic 1)
Now, Alice wants to maximize the total area covered by these triangles between the two vertical sticks.
Note :
1. The triangles DON’t have to be totally between the two vertical sticks. But the area out of the two sticks should not be taken into consideration.
2. These triangles are either acute triangle or right triangle.
输入解释
There are several cases. The first line of the input is a single integer T. (T<=100)
For each case, the first line contains two integers N ,R. (N<=1000,R<=100000)
The next N lines, each line contains three integer a,b,c , which stand for the lengths of three edges of the i-th triangle.
(0<a<=b<=c<100000,a2+b2>=c2).
输出解释
For each case, output "Case #X: " first, X is the case number starting from 1. Then output the maximum area Alice can use these triangles to cover between the two sticks, round to 3 decimal places.
输入样例
2 
1 5
3 4 5
2 4
3 4 5
3 4 5
输出样例
Case #1: 6.000
Case #2: 10.667
来自杭电HDUOJ的附加信息
Recommend zhuyuanchen520

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

源链接: HDU-4682

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

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 65535/32768K(Java/Others)