There are several ways to measure how high a model rocket rises. One method works as follows.
Observers A, B, and C stand on one straight line, with distance D between each adjacent pair. Each observer uses a theodolite mounted H units above the ground.
After launch, near its highest point, the rocket opens its parachute and releases a cloud of dust. Each observer measures the angle from the horizontal line to that dust cloud. If the angles measured by A, B, and C are a, b, and c, respectively, those values can be used to determine the rocket's height above the ground.
Given D, H, a, b, and c, write a program that computes the rocket's height rounded to the nearest integer.
The first line contains decimal numbers D and H. They may be non-integers, and they are the same for every rocket observation.
Each following line contains the three angles a, b, and c, in degrees, for one rocket. The final line contains a value that is not positive and marks the end of the input. Except for the final line, every angle is greater than 0 degrees and less than 90 degrees.
For each triple of angles, print the computed height rounded to the nearest integer, one result per line.