Inscribed Circles
Given two real numbers
B the width of the base of an isoceles triangle in inches
H the altitude of the same isoceles triangle in inches
You have to find the sum of the circumfrences of a series of inscribed circles stacked one on top of another from the base to the peak; such that the lowest inscribed circle is tangent to the base and the two sides and the next higher inscribed circle is tangent to the lowest inscribed circle and the two sides, etc. In order to keep the time required to compute the result within reasonable bounds, you may limit the radius of the smallest inscribed circle in the stack to a single precision floating point value of 0.000001.
Input-two real numbers B, the base, and H the altitude of the isosceles triangle.
( 0.0 <= B, H <= 500 )
( 0.0 <= B, H <= 500 )
Output-the sum of the circumfrences with 6 decimal point precision.
Example
Input
0.3456 0.6543Output
2.055532
The image shows the inner circles of a triangle.
Submit solution
Sign in to submit a solution.