编程介的小学生
2017-06-06 16:41
采纳率: 92.5%
浏览 645
已采纳

Who will be the HDU-START tonight?

Problem Description

Here goes the Problem:

As the picture shown above, there is funnel upside the container. You can assume the bottom of the container is a square. Initially, there are some water in the funnel, the funnel's bottom diameter is x, y stands for the top diameter of the water. Z means the height of the water. The container's height is h, and its bottom is a d*d size square.
The question is: when all the water in the funnel has leaked out, what's the height of the water in the container?
Tips: The Volume of a frustum of a cone(圆台) is:,s1 and s2 are the area of the 2 faces, and H is the height.

Input
There will be multiple input sets. Input for each set is five positive integers x, y, z, h and d(x<y, 1<=x, y, z, h, d <= 10000) . The final input set is followed by a line containing five 0s, indicating end of input.

Output
Output for each input set should be one line, containing a number H, the height of the water in the container, accurate up to 3 decimal places.

Sample Input
1 2 1 3 3
0 0 0 0 0

Sample Output
0.204

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

相关推荐 更多相似问题