提交时间:2022-10-17 13:59:24
运行 ID: 60879
#include <bits/stdc++.h> using namespace std; signed main(){ #define int long long int t, x1, y1, x2, y2, x3, y3, r; cin >> t; while(t--){ cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> r; int A=y1-y2,B=x2-x1; int C=-(A*x1+B*y1); long double minm=abs(A*x3+B*y3+C)/sqrt((long double)A*A+B*B)-r; long double maxm=sqrt((long double)(x3-x1)*(x3-x1)+(y3-y1)*(y3-y1)); maxm=max(maxm,sqrt((long double)(x3-x2)*(x3-x2)+(y3-y2)*(y3-y2)))+r; // printf("%.2lf %.2lf\n",(double)minm,(double)maxm); printf("%.2Lf %.2Lf\n",minm,maxm); } return 0; }//无语,故贺题解之