提交时间:2022-10-15 11:29:20

运行 ID: 60389

#include<bits/stdc++.h> using namespace std; const int N =1e6+10; double cal(double x1,double y1,double x2,double y2) { return sqrt(abs(x1-x2)*abs(x1-x2)+abs(y1-y2)*abs(y1-y2)); } signed main() { int t; scanf("%d",&t); while(t--) { double x1,y1,x2,y2,x3,y3,r; scanf("%lf%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3,&r); double l1=cal(x1,y1,x2,y2); double l2=cal(x2,y2,x3,y3); double l3=cal(x1,y1,x3,y3); double ans1=(abs(l2*l2-l3*l3)+l1*l1)/(2*l1); double ans2=cal(x1,y1,x3,y3); double ans3=cal(x2,y2,x3,y3); ans2=max(ans2,ans3); if(l2<l3) l2=l3; printf("%.2lf %.2lf\n",sqrt(l2*l2-ans1*ans1)-r,ans2+r); } return 0; }