3328 - Circles in the Angle

Created by Alfredo Fundora Rolo
Added by alfredo12345 (2015-06-14)
Limits
Total Time: 3000 MS | Test Time: 2500 MS |Memory: 256 MB | Output: 64 MB | Size: 16 KB
Enabled languages
Available in

Description

Vasya recently learned about geometry and became obsessed with calculating areas. In a dream he thought of an infinite chain of circles of varying radii. He is so thorough in his dreams that he devised a clever method to construct such a chain. First, he would draw a circle of radius R_1 that is tangent to the rays of an angle. Then, he would draw another circle of radius R_2 that is also tangent to the rays of the same angle, and also externally tangent to the first circle. He would then continue drawing his infinite sequence of circles. In the i-th step, he draws a circle that is tangent to the rays of an angle and also externally tangent to the circle drawn in the (i - 1)-th step. The following picture illustrates the process described above up to the third step.




Consider that the angle has an appropriate value that allows the sequence of circles to be drawn as described in Vasya's dream. Your task is to calculate the area of the bounded region of the inner plane angle that lies outside the infinite sequence of circles.
Recientemente Vasya aprendió sobre geometría y se obsesionó con el cálculo de áreas. En un sueño, pensó en una cadena de círculos de distintos radios. Él es tan exhaustivo en sus sueños, que ideó un método inteligente para la construcción de tal cadena. En un primer paso, Vasya dibujaría un círculo de radio R_1 que fuere tangente a los rayos de un ángulo. Luego, dibujaría otro círculo de radio R_2 que a su vez fuere tangente a los rayos del mismo ángulo, y también tangente externamente al primer círculo. Él continuaría este proceso infinitamente. En el i-ésimo paso, Vasya dibujaría un círculo tangente a los rayos del ángulo y también tangente externamente al círculo dibujado en el (i-1)-ésimo paso. La siguiente ilustración muestra este proceso hasta el tercer paso.



Considere que el ángulo tiene una medida adecuada que permite la representación de la figura. Su tarea es calcular el área de la región acotada del plano interior al ángulo y exterior a la cadena infinita de círculos.
Vasya recently learned about geometry and became obsessed with calculating areas. In a dream he thought of an infinite chain of circles of varying radii. He is so thorough in his dreams that he devised a clever method to construct such a chain. First, he would draw a circle of radius R_1 that is tangent to the rays of an angle. Then, he would draw another circle of radius R_2 that is also tangent to the rays of the same angle, and also externally tangent to the first circle. He would then continue drawing his infinite sequence of circles. In the i-th step, he draws a circle that is tangent to the rays of an angle and also externally tangent to the circle drawn in the (i - 1)-th step. The following picture illustrates the process described above up to the third step.




Consider that the angle has an appropriate value that allows the sequence of circles to be drawn as described in Vasya's dream. Your task is to calculate the area of the bounded region of the inner plane angle that lies outside the infinite sequence of circles.

Input specification

Input consists of several test cases, no more than 10000 test cases. Each test case consists of a line containing two integers R_1 and R_2 (0 < R_2 < R_1 <= 100) separated by a single blank space. The last line of input is followed by a line containing two zeros, which should not be processed.
La entrada consiste de múltiples casos de prueba, no más de 10000. Cada caso consiste en una línea con los números enteros R_1 y R_2 (0 < R_2 < R_1 <= 100) separados por un espacio en blanco. Al último caso de prueba le sigue una línea con dos ceros que no debe ser procesada.
Input consists of several test cases, no more than 10000 test cases. Each test case consists of a line containing two integers R_1 and R_2 (0 < R_2 < R_1 <= 100) separated by a single blank space. The last line of input is followed by a line containing two zeros, which should not be processed.

Output specification

For each test case output a single line with the required area. The answer for each test case is accepted if its absolute error does not exceed 1e-4. You may print the solution with an arbitrary number of decimal places, even more than 10.
Para cada caso usted debe imprimir en una línea el valor del área de la región descrita anteriormente. La respuesta para cada caso de prueba se considerará aceptada si su error absoluto no excede 1e-4. Usted puede imprimir una solución con cualquier cantidad de cifras decimales (incluso más de 10).
Input consists of several test cases, no more than 10000 test cases. Each test case consists of a line containing two integers R_1 and R_2 (0 < R_2 < R_1 <= 100) separated by a single blank space. The last line of input is followed by a line containing two zeros, which should not be processed.

Sample input

2 1
4 1
6 1
0 0

Sample output

2.201081
3.145578
4.134338

Hint(s)