提交时间:2022-10-15 11:24:41
运行 ID: 60309
#include <bits/stdc++.h> using namespace std; double x[5],y[5],r,lenab,lenac,lenbc,p,s; 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%lf",&x[1],&y[1],&x[2],&y[2],&x[3],&y[3],&r); lenab=sqrt((x[1]-x[2])*(x[1]-x[2])+(y[1]-y[2])*(y[1]-y[2])), lenac=sqrt((x[1]-x[3])*(x[1]-x[3])+(y[1]-y[3])*(y[1]-y[3])), lenbc=sqrt((x[3]-x[2])*(x[3]-x[2])+(y[3]-y[2])*(y[3]-y[2])), p=(lenab+lenac+lenbc)/2,s=sqrt(p*(p-lenab)*(p-lenac)*(p-lenbc)); // cout<<s<<endl; // cout<<lenab<<endl; printf("%.2lf %.2lf\n",max(s/lenab*2.0-1.0*r,0.0),max(lenac,lenbc)+1.0*r); } return 0; }