#include #include #include #include using namespace std; struct node{ double x,y; }p[5]; const double epx=0.0001; double dist1[4],dist2[4],dist3[4]; int main(){ int t; scanf("%d",&t); while(t--){ for(int i=0;i<5;i++){ scanf("%lf%lf",&p[i].x,&p[i].y); } int cnt1=0,cnt2=0; for(int i=1;i<5;i++){ dist1[cnt1++]=sqrt(pow(p[i].x-p[0].x,2)+pow(p[i].y-p[0].y,2)); //printf("%lf\n",dist[i]); } sort(dist1,dist1+4); for(int i=0;i<4;i++){ dist2[cnt2++]=sqrt(pow(p[i].x-p[4].x,2)+pow(p[i].y-p[4].y,2)); //printf("%lf\n",dist[i]); } sort(dist2,dist2+4); if(abs(dist1[0]-dist1[1])