#include<cstdio>
#include<cmath>
#include<iostream>
using namespace std;
int main()
{
int s;
double x1,x2,x3,y1,y2,y3,a,b,c,k,d;
cin>>s;
while(s--)
{
double sum1,sum2;
cin>>x1>>y1;
cin>>x2>>y2;
cin>>x3>>y3;
a=(y2-y1)/((x2-x1)*(x2-x1));
b=-2*a*x1;
c=a*x1*x1+y1;
k=(y3-y2)/(x3-x2);
d=y2-k*x2;
sum1=a*x3*x3*x3/3+b*x3*x3/2+c*x3-k*x3*x3/2-d*x3;
sum2=a*x2*x2*x2/3+b*x2*x2/2+c*x2-k*x2*x2/2-d*x2;
printf("%.2lf\n",sum1-sum2);
}
return 0;
}
#include<cmath>
#include<iostream>
using namespace std;
int main()
{
int s;
double x1,x2,x3,y1,y2,y3,a,b,c,k,d;
cin>>s;
while(s--)
{
double sum1,sum2;
cin>>x1>>y1;
cin>>x2>>y2;
cin>>x3>>y3;
a=(y2-y1)/((x2-x1)*(x2-x1));
b=-2*a*x1;
c=a*x1*x1+y1;
k=(y3-y2)/(x3-x2);
d=y2-k*x2;
sum1=a*x3*x3*x3/3+b*x3*x3/2+c*x3-k*x3*x3/2-d*x3;
sum2=a*x2*x2*x2/3+b*x2*x2/2+c*x2-k*x2*x2/2-d*x2;
printf("%.2lf\n",sum1-sum2);
}
return 0;
}