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

建议使用的浏览器:

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

2767:Bowlstack

题目描述
Baking bread is my favourite spare-time pursuit. I have a number of stainless steel mixing bowls with straight sides, a circular bottom and a wider circular top opening. Geometrically, my bowls are truncated circular cones and for this problem, the thickness of the metal may be disregarded.

I store these bowls stacked in the natural way, that is with a common vertical axis, and I stack them in an order that minimises the total height of the stack. Finding this minimum is the purpose of your program.
输入解释
On the first line of the input is a positive integer, telling the number of test cases to follow. Each case starts with one line containing an integer n, the number of bowls (2 ≤ n ≤ 9). The following n lines each contain three positive integers h, r, R, specifying the height, the bottom radius and the top radius of the bowl, and r < R holds true. You may also assume that h, r, R < 1000.
输出解释
For each test case, output one line containing the minimal stack height, truncated to an integer (note: truncated, not rounded).
输入样例
2
2
60 20 30
40 10 50
3
50 30 80
35 25 70
40 10 90
输出样例
70
55

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-2767

最后修改于 2020-10-29T06:42:37+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536