提交时间:2022-10-15 11:26:19
运行 ID: 60341
#include <bits/stdc++.h> using namespace std; int T; double dis1,dis2,dis3,p,s,x[5],y[5],r; int main(){ // freopen("S1.in","r",stdin); // freopen("S1.out","w",stdout); cin>>T; while(T--){ cin>>x[1]>>y[1]>>x[2]>>y[2]>>x[3]>>y[3]>>r; dis1=sqrt((x[1]-x[2])*(x[1]-x[2])+(y[1]-y[2])*(y[1]-y[2])); dis2=sqrt((x[1]-x[3])*(x[1]-x[3])+(y[1]-y[3])*(y[1]-y[3])); dis3=sqrt((x[2]-x[3])*(x[2]-x[3])+(y[2]-y[3])*(y[2]-y[3])); p=(dis1+dis2+dis3)/2,s=sqrt(p*(p-dis1)*(p-dis2)*(p-dis3)); printf("%.2lf %.2lf\n",s/dis1*2.0-1.0*r,max(dis2,dis3)+1.0*r); } return 0; }