Quido is fond of Apollonian gaskets. They are planar fractals generated from triples of circles, where each circle is tangent to the other two. In his drawing of the gasket, Quido starts with two externally tangent circles which diameter is D1 and D2. Then he adds a third circle which diameter is D1+D2 and to which the two original circles are internally tangent. This is the first generation of circles.
Each subsequent generation of circles is constructed by applying the following scheme:
For any three circles A, B C of any previous generations which are tangent to each other a new circle is constructed which is tangent to A,B,C. The new circle must differ from all circles constructed so far. When a generation is complete, i.e no other circle can be added, then the next generation of circles can start being constructed.
The leftmost scheme shows the first generation, each next scheme contains one more generation of circles.
There is an additional stopping rule which prevents Quido from generating infinitesimally small circles. A circle can be added to the gasket if and only if the lenght of its diameter is least minD which is a fixed positive value.
Given the values D1, D2 and minD find the sum of areas and also the sum of perimeters of all circles in the gasket excluding the largest one.
Input consists of one line with three decimal numbers D1, D2 and minD. The number are separated by spaces. The format is usual decimal format (see also the examples bellow) with no exponent part.
It holds that 1.0 ≤ D1, D2 ≤ 1000.0, 0.001 ≤ minD ≤ D1+D2.
Ouput consists of one text line containing two decimal numbers L1 and L2. L1 represents the sum of areas of all circles in the gasket except for the bigggest circle. L2 represents the sum of perimeters of all circles in tin the gasket except for the bigggest circle. Both output values are rounded to 3 decimal digits. Decimal digits must be always present in the output even if some of them are zeros.
Maximim output value is less than 107.
17.000000 40.000000 1.000000
10.000000 10.000000 2.000000
2.000000 50.000000 1.000000
1000.022000 811.047000 0.025000
P.S Code should be written with the help of 2D or 3D or moreD matrices without using Numpy
2 freelance font une offre moyenne de €23 pour ce travail
Hello Sir/ Ma’am As a highly skilled full stack developer, I have rich experience in JAVA, C, C++, C# Python and ANDROID. I am very confident with my skills and I'd like to help your business by doing my best. My cli Plus
I am skilled in python... and I am very good in python... I have won on many rounds in competitive programming (codearena) in [login to view URL] I think I am suitable to solve this problem.