Colin is a huge fan of the Kingdom Rush franchise tower defense games. Last year, KR released the latest generation of Kingdom Rush: Kingdom Rush 5: Alliance. As a formidable evil arises in the new generation, an unexpected alliance is taking shape! It will take the finest warriors of Linirea and the relentless Dark Army together to stop it. Therefore, the most attractive feature of the latest generation of games is that you can use two heroes simultaneously!
To measure the power of the double-hero feature, Colin would like to do some simple experiments: Assume that a hero's attack range is a circle on the 2D plane with its coordinates as the center. The path of enemies is a segment on the 2D plane. Colin would like to ask you how long the total length of the enemy's path is that is covered by at least one hero's attack range?
The first line contains three integers $$$x_1,y_1,r_1\ (|x_1|,|y_1|\le 10^9, 1\le r_1\le 10^9)$$$, representing the coordinates of the first hero as $$$(x_1,y_1)$$$, and the radius of its attack range is $$$r_1$$$.
The second line contains three integers $$$x_2,y_2,r_2\ (|x_2|,|y_2|\le 10^9, 1\le r_2\le 10^9)$$$, representing the coordinates of the second hero as $$$(x_2,y_2)$$$, and the radius of its attack range is $$$r_2$$$.
The third line contains four integers $$$a,b,c,d~(|a|,|b|,|c|,|d|\le 10^9)$$$, representing the path of enemies as a segment from $$$(a,b)$$$ to $$$(c,d)$$$.
A single line with a number, representing the total length of the enemy's path that is covered by at least one hero's attack range.
Your output will be considered correct if the absolute or relative error to the jury does not exceed $$$10^{-6}$$$.
0 0 11 1 10 0 1 1
1.414213562373095
0 0 12 2 1-1 -1 3 3
4.000000000000000
| Name |
|---|


