Problem8565--CGL_7_E : Cross Points of Circles

8565: CGL_7_E : Cross Points of Circles

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 256 MiB  Special Judge

Description

For given two circles $c_1$ and $c_2$, print the coordinates of the cross points of them.

Input

The input is given in the following format.
$c_{1x}\ c_{1y}\ c_{1r}$
$c_{2x}\ c_{2y}\ c_{2r}$
$c_{1x}, c_{1y}$ and $c_{1r}$ represent the coordinate and radius of the first circle. $c_{2x}, c_{2y}$ and $c_{2r}$ represent the coordinate and radius of the second circle. 
All input values are given in integers.

Output

Print the coordinates $(x_1, y_1)$ and $(x_2, y_2)$ of the cross points $p_1$ and $p_2$ respectively in the following rules.
  • If there is one cross point, print two coordinates with the same values.
  • Print the coordinate with smaller $x$ first. In case of a tie, print the coordinate with smaller $y$ first.
The output values should be in a decimal fraction with an error less than 0.000001.

Constraints

The given circle have at least one cross point and have different center coordinates.
$−10,000≤c_{1x},c_{1y},c_{2x},c_{2y}≤10,000$
$1≤c_{1r},c_{2r}≤10,000$

Sample 1 Input

0 0 2
2 0 2

Sample 1 Output

1.00000000 -1.73205080 1.00000000 1.73205080

Sample 2 Input

0 0 2
0 3 1

Sample 2 Output

0.00000000 2.00000000 0.00000000 2.00000000

HINT

相同题目:CGL_7_E

Source/Category