Cocktail
Cylindrical vessel of height H (0 < H ≤ 10000) and bottom radius R (0 < R ≤ 10000) stands on a horizontal surface. There are two liquids in the vessel. The liquids have different density and do not mix. d[1]
and d[2]
are densities of the first and the second liquids respectively (0 < d[2]
< d[1]
≤ 10000). h[1]
and h[2]
are heights of layers of the first and the second liquids (h[1]
, h[2]
> 0, h[1]
+ h[2]
≤ H). There is a cube made of a solid material. The cube's edge length is n (0 < n ≤ 1.4 * R), the material's density is d (0 < d ≤ 10000). The cube is put down into the vessel in such a way that one of its sides is horizontal. Pay attention that some amount of liquid may pour out of the vessel. As a result of the operation the cube floats in liquids or lie on the vessel bottom.
You need to calculate the height of the vessel which is occupied by the liquids after the cube is put down into the vessel. You may neglect damping and some other physical effects, but you should take into account Archimedean Principle.
Input
The only line contains numbers H, R, d[1]
, h[1]
, d[2]
, h[2]
, d and n. All the numbers are real. Each of them does not contain more than three digits in its fractional part.
Output
Print one real number - the height you need to calculate. Absolute error must not exceed 10^(-3)
.