Refract Facts

Given the submarine depth, jet height, horizontal distance and refraction indices, compute the laser elevation angle that hits the jet after refraction.

Medium5Binary searchMathNo attempts yetTime limit1sMemory limit256 MB

Problem

A submarine sends a message to a jet cruising overhead with a communications laser. The sea surface is flat. The submarine cruises at depth dd below the surface. The jet is at height hh above the surface and at horizontal distance xx from the submarine. The submarine already turned toward the jet before starting communications, so the only thing left to settle is the angle of elevation ϕ\phi at which to aim the laser.

When the laser passes from the sea into the air it is refracted, so its path bends. Snell's law describes the refraction. Light that reaches the flat surface at angle θ1\theta_1 from the vertical leaves at angle θ2\theta_2 from the vertical, and the two angles satisfy

sinθ1sinθ2=n1n2\frac{\sin \theta_1}{\sin \theta_2} = \frac{n_1}{n_2}

θ1\theta_1 is measured in the water and θ2\theta_2 in the air, both from the vertical, and n1n_1 and n2n_2 are the refraction indices of the water and the air. The refraction index of a material is inversely proportional to how fast light travels through that material.

The angle of elevation ϕ\phi is measured from the horizontal at the submarine.

Input

The input consists of one or more datasets.

Each dataset is one line with five floating point numbers, in this order:

  • dd, the depth of the submarine (of the laser emitter, to be exact) in feet, 1d8001 \leq d \leq 800
  • hh, the height of the jet in feet, 100h10000100 \leq h \leq 10\,000
  • xx, the horizontal distance from the submarine to the jet in feet, 0x100000 \leq x \leq 10\,000
  • n1n_1, the refraction index of the water, 1.0<n12.51.0 < n_1 \leq 2.5
  • n2n_2, the refraction index of the air, 1.0n2<n11.0 \leq n_2 < n_1

A line whose dd is 0 ends the input. All five numbers on that line are 0 and the line is not a dataset.

Output

For each dataset, print one line with the angle of elevation in degrees at which the submarine should aim its laser to illuminate the jet. Round the angle to the closest 1/100 of a degree and print exactly two digits after the decimal point.