版本2和3间的区别
于2006-04-21 20:53:46修订的的版本2
大小: 1706
编辑: czk
备注:
于2008-02-23 15:37:07修订的的版本3
大小: 1714
编辑: localhost
备注: converted to 1.6 markup
删除的内容标记成这样。 加入的内容标记成这样。
行号 11: 行号 11:
attachment:1904.gif
attachment:1904.jpg
{{attachment:1904.gif}}
{{attachment:1904.jpg}}

Beavergnaw

http://acm.zju.edu.cn/show_problem.php?pid=1904

Time limit: 1 Seconds

Memory limit: 32768K

When chomping a tree the beaver cuts a very specific shape out of the tree trunk. What is left in the tree trunk looks like two frustums of a cone joined by a cylinder with the diameter the same as its height. A very curious beaver tries not to demolish a tree but rather sort out what should be the diameter of the cylinder joining the frustums such that he chomped out certain amount of wood. You are to help him to do the calculations.

1904.gif 1904.jpg

We will consider an idealized beaver chomping an idealized tree. Let us assume that the tree trunk is a cylinder of diameter D and that the beaver chomps on a segment of the trunk also of height D. What should be the diameter d of the inner cylinder such that the beaver chomped out V cubic units of wood?

1. Input

Input contains multiple cases each presented on a separate line. Each line contains two integer numbers D and V separated by whitespace. D is the linear units and V is in cubic units. V will not exceed the maximum volume of wood that the beaver can chomp. A line with D=0 and V=0 follows the last case.

2. Output

For each case, one line of output should be produced containing one number rounded to three fractional digits giving the value of d measured in linear units.

3. Sample Input

10 250
20 2500
25 7000
50 50000
0 0

4. Sample Output

8.054
14.775
13.115
30.901

Problem Source: University of Waterloo Local Contest 2002.07.01


zju1904 (2008-02-23 15:37:07由localhost编辑)

ch3n2k.com | Copyright (c) 2004-2020 czk.