题目描述
Rope-pulling (also known as tug of war) is a very popular game in Ropeland, just like cricket is in Bangladesh. Two groups of players hold different ends of a rope and pull. The group that snatches the rope from the other group is declared winner.
Due to a rope shortage, the king of the country has declared that groups will not be allowed to buy longer ropes than they require.
Rope-pulling takes place in a large room, which contains a large round pillar of a certain radius. If two groups are on the opposite side of the pillar, their pulled rope cannot be a straight line. Given the position of the two groups, find out the minimum length of rope required to start rope-pulling. You can assume that a point represents the position of each group.
Two groups with the round pillar between them.
Two groups unaffected by the pillar
输入
The first line of the input file contains an integer N giving the number of input cases. Then follow N lines, each containing five numbers X1, Y1, X2, Y2, and R, where (X1, Y1) and (X2, Y2) are the coordinates of the two groups and R > 0 is the radius of the pillar.
The center of the pillar is always at the origin, and you may assume that neither team starts in the circle. All input values except for N are floating point numbers, and all have absolute value <= 10,000.
输出
For each input set, output a floating point number on a new line rounded to the third digit after the decimal point denoting the minimum length of rope required.
样例输入
2
1 1 -1 -1 1
1 1 -1 1 1
样例输出
3.571
2.000
参考代码
暂无
解析
暂无