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

建议使用的浏览器:

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

3453:Fruit Bowl

题目描述
For her next project, Beebe Flat wishes to paint a bowl of fruit.Naturally, the bowl is two-dimensional, as is all of the fruit. She bought a triangular bowl which somehow always manages to stay upright, with a perfectly level top. The bowl has a height H, and opens A degrees to the left and B degrees to the right
(see diagram).
In the interest of art, Beebe eschews symmetry,so A ≠ B. She plans to buy perfectly circular fruit, each with radius 1, to put into the bowl. However, perfectly circular fruit is expensive, so she needs your help to figure out how much fruit she has to buy. She plans to fill the bowl to the brim,adding as much fruit as possible without any part exceeding the height of the bowl. Thankfully, she is not interested in an optimal packing, since she wants a simple algorithm for actually arranging the fruit. She will place the fruit one at a time, each time choosing the lowest possible location for the center.Since Beebe doesn't like to deal with ties, she always purchases a bowl such that there is only one lowest possible location within a margin of 10-5. Finally, to ensure that a lid will fit nicely on the bowl when she's done painting, she only
chooses bowls such that, when properly packed, the last piece of fruit to fit will be at least 10-2 below the top, and the next piece of fruit that would fit if the bowl were taller will jut out at least 10-2 above the top.Given a particular bowl, how many pieces of fruit does Beebe need to buy to fill the bowl in this manner?
输入解释
The input consists of multiple test cases. Each test case has three integers on a single line, denoting A, B,and H. 1 <= A,B <= 45, A 6= B, and 1 <= H <= 300. The last test case will be followed by A = B = H = 0,which should not be processed.
输出解释
For each test case, print on a single line the number of pieces of fruit that Beebe needs to buy to fill the given bowl.
输入样例
20 30 10
10 20 20
0 0 0
输出样例
9
25
来自杭电HDUOJ的附加信息
Recommend zhengfeng

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

源链接: HDU-3453

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

共提交 0

通过率 --%
时间上限 内存上限
50000/20000MS(Java/Others) 32768/32768K(Java/Others)