F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Who will be the HDU-START tonight?

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 741    Accepted Submission(s): 198


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
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-25 08:10:30, Gzip enabled