# 题目大意：

#include <iostream>
#include <cstdio>
#include <cmath>
#define eps 1e-9
using namespace std;

int main()
{
int N;
double x1,x2,y1,y2,e2,f2,g2,r,A,ans;
scanf("%d",&N);
while(N--)
{
scanf("%lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&r);
e2 = (x1-x2)*(x1-x2) +(y1-y2)*(y1-y2);
f2 = x1*x1 + y1*y1;
g2 = x2*x2 + y2*y2;
A = fabs(acos((x1*x2+y2*y1)/sqrt(f2*g2))) - acos(r/sqrt(f2)) - acos(r/sqrt(g2));
//printf("A = %lf\n",A);
if(A>-eps) ans = A*r + sqrt(f2 - r*r) + sqrt(g2 - r*r);
else
ans = sqrt(e2);
printf("%.3lf\n",ans);
}
return 0;
}


#### UVA, 10180 Rope Crisis in Ropeland!

2016-05-25 16:46:03

#### UVa 10180 - Rope Crisis in Ropeland!

2015-03-28 23:27:43

#### UVA 10180 Rope Crisis in Ropeland!【判断圆与直线位置】

2013-05-14 20:46:14

#### UVa Problem 10180 Rope Crisis in Ropeland! （绳子王国的危机！）

2011-11-09 21:22:25

#### Rope Crisis in Ropeland

2010-11-04 16:02:00

#### uva_10180_Rope Crisis in Ropeland!_WA

2016-05-19 11:40:56

#### UVa 151 - Power Crisis

2014-06-23 10:50:24

#### UVA 12186 Another Crisis

2015-04-29 20:39:22

#### uva 151 - Power Crisis

2013-05-20 17:16:49

#### UVA 12538 rope容器

2018-05-23 21:22:09