提交时间:2022-10-15 11:25:15

运行 ID: 60319

#include<bits/stdc++.h> using namespace std; double x[5],y[5],r,p,S,h; double maxn,minn; double dis1,dis2,dis3; int t; int main(){ //freopen("S1.in","r",stdin); //freopen("S1.out","w",stdout); scanf("%d",&t); while(t--){ scanf("%lf%lf%lf%lf%lf%lf",&x[1],&y[1],&x[2],&y[2],&x[3],&y[3]); scanf("%lf",&r); dis1=sqrt((x[1]-x[3])*(x[1]-x[3])+(y[1]-y[3])*(y[1]-y[3])); dis2=sqrt((x[2]-x[3])*(x[2]-x[3])+(y[2]-y[3])*(y[2]-y[3])); dis3=sqrt((x[1]-x[2])*(x[1]-x[2])+(y[1]-y[2])*(y[1]-y[2])); maxn=max(dis1,dis2)+r; p=(dis1+dis2+dis3)/2; S=sqrt(p*(p-dis1)*(p-dis2)*(p-dis3)); h=2*S/dis3; minn=h-r; printf("%.2lf ",minn); printf("%.2lf\n",maxn); } return 0; }