{"raw_statement":[{"iden":"statement","content":"You are given two circles on a plane. It is guaranteed that their circumferences have exactly two common points.\n\nThe result of the intersection of two circles is a figure with the positive area consisting of points belonging to both circles.\n\nYou have to inscribe a circle of the maximal possible radius into this figure. Output the coordinates of its center and its radius.\n\nThe first line contains three integers $x_1$, $y_1$, $r_1$ ($-1000 <= x_1, y_1 <= 1000, 1 <= r_1 <= 1000$) — coordinates of the center of the first circle and its radius.\n\nThe second line contains three integers $x_2$, $y_2$, $r_2$ ($-1000 <= x_2, y_2 <= 1000, 1 <= r_2 <= 1000$) — coordinates of the center of the second circle and its radius.\n\nOutput three real numbers $x$, $y$, $r$ — coordinates of the center and radius of the resulting circle. Each of the printed numbers should have absolute or relative error not exceeding $10^(-9)$.\n\n"},{"iden":"input","content":"The first line contains three integers $x_1$, $y_1$, $r_1$ ($-1000 <= x_1, y_1 <= 1000, 1 <= r_1 <= 1000$) — coordinates of the center of the first circle and its radius.The second line contains three integers $x_2$, $y_2$, $r_2$ ($-1000 <= x_2, y_2 <= 1000, 1 <= r_2 <= 1000$) — coordinates of the center of the second circle and its radius."},{"iden":"output","content":"Output three real numbers $x$, $y$, $r$ — coordinates of the center and radius of the resulting circle. Each of the printed numbers should have absolute or relative error not exceeding $10^(-9)$."},{"iden":"examples","content":"Input0 0 5\n6 0 5\nOutput3.000000000000000 0.000000000000000 2.000000000000000\nInput-12 34 56\n78 -90 123\nOutput13.322257821855908 -0.888444110112585 12.890601098820779\n"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ C_1 = (x_1, y_1, r_1) $ and $ C_2 = (x_2, y_2, r_2) $ be two circles in $ \\mathbb{R}^2 $, with centers $ (x_1, y_1) $, $ (x_2, y_2) $ and radii $ r_1, r_2 > 0 $, respectively.  \nLet $ d = \\sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2} $ be the distance between centers.  \nGiven: $ |r_1 - r_2| < d < r_1 + r_2 $ (circumferences intersect at exactly two points).\n\nLet $ R $ be the intersection region: $ R = \\overline{B}((x_1, y_1), r_1) \\cap \\overline{B}((x_2, y_2), r_2) $, where $ \\overline{B}(c, r) $ denotes the closed disk centered at $ c $ with radius $ r $.\n\n**Objective**  \nFind the circle $ C = (x, y, r) $ of maximal radius $ r $ such that $ C \\subseteq R $.  \nOutput: $ (x, y, r) $, where $ (x, y) $ is the center and $ r $ is the radius of this maximal inscribed circle.\n\n**Solution**  \nThe maximal inscribed circle in the intersection of two disks is centered on the line segment joining the two centers, and its radius is determined by the geometry of the lens-shaped intersection.  \nLet $ \\vec{v} = (x_2 - x_1, y_2 - y_1) $.  \nThe center lies along the line connecting $ (x_1, y_1) $ and $ (x_2, y_2) $, at a point dividing the segment in the ratio of the radii.  \nThe radius $ r $ of the maximal inscribed circle is given by:  \n$$\nr = \\frac{r_1 + r_2 - d}{2}\n$$  \nThe center $ (x, y) $ lies on the line segment between $ (x_1, y_1) $ and $ (x_2, y_2) $, at distance $ r_1 - r $ from $ (x_1, y_1) $:  \n$$\n(x, y) = \\left( x_1 + \\frac{r_1 - r}{d} (x_2 - x_1),\\ y_1 + \\frac{r_1 - r}{d} (y_2 - y_1) \\right)\n$$","simple_statement":"Given two circles that intersect at exactly two points, find the largest circle that fits entirely inside their overlapping region. Output the center (x, y) and radius r of this largest circle.","has_page_source":false}