Cocktail

No attempts yetTime limit1sMemory limit128 MB

Problem

A cylindrical vessel of height HH (0<H100000 < H \le 10000) and bottom radius RR (0<R100000 < R \le 10000) stands on a horizontal surface. It holds two liquids that have different densities and do not mix. Let D1D_1 and D2D_2 be the densities of the first and second liquids, with 0<D2<D1100000 < D_2 < D_1 \le 10000, so the denser first liquid forms the lower layer and the second liquid rests on top. Let h1h_1 and h2h_2 be the heights of the two layers, with h1,h2>0h_1, h_2 > 0 and h1+h2Hh_1 + h_2 \le H.

A solid cube has edge length nn (0<n1.4R0 < n \le 1.4R) and is made of a material of density DD (0<D100000 < D \le 10000). The cube is lowered into the vessel so that one of its faces stays horizontal. Some liquid may spill over the rim. When it comes to rest, the cube either floats in the liquids or lies on the bottom.

Using Archimedes' principle (and neglecting damping and other minor physical effects), compute the height of the liquid column in the vessel after the cube has been placed.

Input

The single line contains the numbers HH, RR, D1D_1, h1h_1, D2D_2, h2h_2, DD, and nn, separated by spaces. All numbers are real and each has at most three digits after the decimal point.

Output

Print one real number: the resulting liquid height, rounded to exactly three digits after the decimal point.