提交时间:2022-10-15 11:39:07

运行 ID: 60443

#include <bits/stdc++.h> using namespace std; double ax,ay,bx,by,cx,cy,r; int t; int main() { scanf("%d",&t); while(t--) { cin>>ax>>ay>>bx>>by>>cx>>cy>>r; double acx=abs(cx-ax),acy=abs(cy-ay),bcx=abs(cx-bx),bcy=abs(cy-by),abx=abs(ax-bx),aby=abs(by-ay); double jl=sqrt((abx*abx)+(aby*aby)); double mj1=bcx*bcy/2; double mj2=abx*aby/2; double mj3=acx*acy/2; double zmj=max(abx,max(bcx,acx))*max(aby,max(bcy,acy)); double h=(zmj-mj1-mj2-mj3)/jl*2-r; printf("%0.2f ",h); double jj=sqrt(acx*acx+acy*acy)+r; double bj=sqrt(bcx*bcx+bcy*bcy)+r; if(jj>bj) printf("%0.2f\n",jj); else printf("%0.2f\n",bj); } return 0; }