Measuring the Height of a Cup Noodle
InterviewTime limit1sMemory limit512 MB
Given two parallel base diameters D1, D2 and the slanted side K of an isosceles trapezoid, compute the squared height.
Problem
A cup noodle container is a conical frustum whose two bases are parallel and circular. Seen from the side, it is an isosceles trapezoid as in the figure below.

In the isosceles trapezoid above, Minsu measured the diameter of the top face of the cup noodle as D1 and the diameter of the bottom face as D2. The length of the side Minsu has not measured yet is K. Write a program that finds the value of (the height of the cup noodle)2. The height of the cup noodle is defined as the distance between the two parallel sides of the isosceles trapezoid.
Input
The first line gives the value of K. The second line gives the values of D1 and D2 in that order, separated by one space. The values of K, D1, and D2 are positive integers.
Output
Print the value of (the height of the cup noodle)2 on the first line. Absolute or relative error up to 10-6 is allowed.
Constraints
- 0 < K, D1, D2 ≤ 100
- 0 ≤ D1-D2 < 2×K