eolymp
bolt
Try our new interface for solving problems
Problems

I want honey!

I want honey!

\includegraphics{https://static.e-olymp.com/content/aa/aab5f4edb53507cb97ae40eca27fa49d7efe4190.jpg} Michael, like his cartoon friend of Winnie the Pooh, was very fond of honey. So he waited impatiently for the moment when the apiary could be tackled his collection. However, there are several problems, primarily due to the fact that the bees themselves is not very fond of this day, when the bear was collecting honey ... Once during the next gathering of honey bees Misha started to bite and as he did not want to harm their tireless hard worker, Michael just started to run away from the apiary, but on the way overturned one of the cans, which had already been partially harvested honey. On the happiness of Misha, a can was closed and the honey is not spread out ... But investigative Masha interested in a very simple question: What level of honey will be in a horizontal cans? Beadon consists of \textbf{2} cylinders, connected by truncated cone (see schematic drawing below, made of a sprig of Masha in the sand). Suppose that in an upright position a can of honey was level \textbf{k}, the height of the bottom of the can is \textbf{h_b}, and its diameter - \textbf{d_b}, suitability height of the upper part of the can is equal to \textbf{h_n}, and the diameter - \textbf{d_n}. The total height of a vertical cans becomes \textbf{h}. Thick bed, walls and cover the can be neglected. \includegraphics{https://static.e-olymp.com/content/4f/4fc79899944d1ba5b80464ba70d14e261413f0ad.jpg} \InputFile The input data consist of several test cases. Each test case on a separate line contains space-separated real values \textbf{k h_b d_b h_n d_n} and \textbf{h}\textit{.} It is guaranteed that \textbf{100} \textit{≥ }\textbf{h}\textit{ ≥ }\textbf{h_b}\textit{ }\textit{\textbf{+ }}\textbf{h_n}\textit{\textbf{ }}and \textbf{100}\textit{ ≥ }\textbf{d_b}\textit{ ≥ }\textbf{d_n}. A string containing the value \textbf{0 0 0 0 0 0} is a signal the end of the input data and is not processed.. \OutputFile For each test case in a separate line output level \textbf{s} of honey in a horizontally tilted cans to within two decimal digits after the decimal point.
Time limit 1 second
Memory limit 64 MiB
Input example #1
5.625 10.0 10.0 5.0 5.0 15.0
0 0 0 0 0 0
Output example #1
5.00
Source Team Cup Ukraine 2011 - schoolchildren - Round 1