#include<cstdio>#include<cmath>double ah,h,ch,bb,cc,k,x1,x2,yy1,y2,x3,y3;// simpson公式用到的函數double F(double x) { return (ah*(x-h)*(x-h)+ch-(k*(x-bb)+cc));}// 三點simpson法。這裡要求F是一個全域函數double simpson(double a, double b) { double c = a + (b-a)/2; return (F(a)+4*F(c)+F(b))*(b-a)/6;}// 自適應Simpson公式(遞迴過程)。已知整個區間[a,b]上的三點simpson值Adouble asr(double a, double b, double eps, double A) { double c = a + (b-a)/2; double L = simpson(a, c), R = simpson(c, b); if(fabs(L+R-A) <= 15*eps) return L+R+(L+R-A)/15.0; return asr(a, c, eps/2, L) + asr(c, b, eps/2, R);}// 自適應Simpson公式(主過程)double asr(double a, double b, double eps) { return asr(a, b, eps, simpson(a, b));}double solve(){ h=x1; ch=yy1; ah=(y3-ch)/((x3-h)*(x3-h)); k=(y3-y2)/(x3-x2); bb=x2; cc=y2; return asr(x2,x3,1e-6);}int main(){ int t; scanf("%d",&t); while(t--) { double ans; scanf("%lf%lf",&x1,&yy1); scanf("%lf%lf",&x2,&y2); scanf("%lf%lf",&x3,&y3); ans=solve(); printf("%.2lf\n",ans); } return 0;}