You're given the centers of three equal sides of a strictly convex tetragon. Your task is to restore the initial tetragon.
The first input line contains one number *T* — amount of tests (1 ≤ *T* ≤ 5·10<sup class="upper-index">4</sup>). Each of the following *T* lines contains numbers *x*<sub class="lower-index">1</sub>, *y*<sub class="lower-index">1</sub>, *x*<sub class="lower-index">2</sub>, *y*<sub class="lower-index">2</sub>, *x*<sub class="lower-index">3</sub>, *y*<sub class="lower-index">3</sub> — coordinates of different points that are the centers of three equal sides (non-negative integer numbers, not exceeding 10).
#include <bits/stdc++.h>
 
using namespace std;
 
#define FIN ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define EPS 1e-6
bool d=false;
 
struct punto
{
  double x;
  double y;
};
 
struct recta
{
  double A;
  double B;
  double C;
};
 
struct vectorc
{
  double vx;
  double vy;
};
 
double producto_cruz_3p(punto p1, punto p2, punto p3)
{
  vectorc v1, v2;
  v1.vx=p2.x-p1.x; v1.vy=p2.y-p1.y;
  v2.vx=p3.x-p2.x; v2.vy=p3.y-p2.y;
  double aux=v1.vx*v2.vy-v1.vy*v2.vx;
  return aux;
}
 
punto simetria_central(punto p1, punto p2)
{
  punto p3;
  p3.x=p1.x+2*(p2.x-p1.x);
  p3.y=p1.y+2*(p2.y-p1.y);
  return p3;
}
 
recta construct_recta(punto p1, punto p2)
{
  recta ans;
  ans.A=(p2.y-p1.y);
  ans.B=(p1.x-p2.x);
  ans.C=p1.x*(p2.y-p1.y)-p1.y*(p2.x-p1.x);
  ans.C*=-1;
  //cout << ans.A << ".x + " << ans.B << ".y +" << ans.C << " = 0\n";
  return ans;
}
 
 
punto interseccion(recta r1, recta r2)
{
  punto aux;
  aux.x=(-1)*(r1.C*r2.B-r2.C*r1.B)/(r1.A*r2.B-r2.A*r1.B);
  aux.y=(-1)*(r1.A*r2.C-r2.A*r1.C)/(r1.A*r2.B-r2.A*r1.B);
  return aux;
}
 
recta mediatriz(punto p1, punto p2)
{
  recta aux=construct_recta(p1,p2);
  recta mediat;
  mediat.A=-1*aux.B;
  mediat.B=aux.A;
  punto medio;
  medio.x=(p1.x+p2.x)/2;
  medio.y=(p1.y+p2.y)/2;
  mediat.C=aux.B*medio.x-aux.A*medio.y;
  return mediat;
}
 
punto circuncentro(punto p1, punto p2, punto p3)
{
  recta r1, r2, r3;
  punto cc;
  r1=mediatriz(p1,p2);
  r2=mediatriz(p2,p3);
  r3=mediatriz(p1,p3);
  cc=interseccion(r1,r2);
  return cc;
}
 
bool colineales(punto p1, punto p2, punto p3)
{
  if(abs(producto_cruz_3p(p1,p2,p3))<1e-5) return true;
  else return false;
}
 
bool funcion(punto p1, punto p2, punto p3)
{
  if(colineales(p1,p2,p3)==true) {return false;}
  punto p4=simetria_central(p3,p2), p5;
  //cout << "Circuncentro = " << p4.x << " ---- " << p4.y << endl;
  if(colineales(p1,p2,p4)==false) {p5=circuncentro(p1,p2,p4); /*cout << "C = " << p5.x << " " << p5.y << endl;*/}
  else return false;
  //cout << p5.x << p5.y << endl;
  punto p6=simetria_central(p5,p1);
  punto p7=simetria_central(p5,p2);
  punto p8=simetria_central(p7,p3);
  double aux1=producto_cruz_3p(p5,p7,p8);
  double aux2=producto_cruz_3p(p7,p8,p6);
  double aux3=producto_cruz_3p(p8,p6,p5);
  double aux4=producto_cruz_3p(p6,p5,p7);
  vector <punto> a;
  //cout << aux1 << " " << aux2 << " " << aux3 << " " << aux4 << endl;
  a.push_back(p5); a.push_back(p7); a.push_back(p8); a.push_back(p6);
  /*for(long i=0; i<4; i++) cout << a[i].x << " " << a[i].y << endl;
  cout << endl << endl;*/
  //convex_hull(a);
  /*for(long i=0; i<4; i++) cout << a[i].x << " " << a[i].y << endl;
  cout << endl;*/
  if(aux1>0 && aux2>0 && aux3>0 && aux4>0 && d==false)
  {
    //cout << p5.x << " " << p5.y << endl << endl;
    d=true;
    printf("YES\n");
    for(long i=0; i<a.size(); i++)
    {
      printf("%.9lg %.9lg ", a[i].x, a[i].y);
      //cout << fixed << setprecision(9) << a[i].x << " " << a[i].y << " ";
    }
    printf("\n");
    /*cout << "\n";*/
  }
  if(aux1<0 && aux2<0 && aux3<0 && aux4<0 && d==false)
  {
    //cout << p5.x << " " << p5.y << endl << endl;
    d=true;
    printf("YES\n");
    /*cout << "YES\n";*/
    for(long i=0; i<a.size(); i++)
    {
      printf("%.15lg %.15lg ", a[i].x, a[i].y);
      /*cout << a[i].x << " " << a[i].y << " ";*/
    }
    printf("\n");
    //cout << endl;
  }
 
  return false;
}
 
int main()
{
  FIN;
  vector<punto> a;
  long t;
  /*punto p1, p2, p3, p4;
  p1.x=4; p1.y=5;
  p2.x=7; p2.y=5;
  p3.x=9; p3.y=5.000001;
  p4.x=1; p4.y=2;
  if(colineales(p1,p2,p3)==true) cout << "Monazo\n\n";
  recta r1=construct_recta(p1,p2);
  recta r2=construct_recta(p3,p4);
  cout << interseccion(r1,r2).x << " " << interseccion(r1,r2).y << endl;*/
 
  //punto p1, p2, p3;
  //p1.x=0; p1.y=0; p2.x=0; p2.y=1; p3.x=1; p3.y=1;
  //cout << producto_cruz_3p(p1,p2,p3) << endl;
  scanf("%ld", &t);
  while(t--)
  {
    punto p1, p2, p3;
    scanf("%lg %lg %lg %lg %lg %lg", &p1.x, &p1.y, &p2.x, &p2.y, &p3.x, &p3.y);
    /*cin >> p1.x >> p1.y >> p2.x >> p2.y >> p3.x >> p3.y;*/
    d=false;
    if(funcion(p1,p2,p3)==true) d=true;
    if(funcion(p1,p3,p2)==true) d=true;
    if(funcion(p2,p1,p3)==true) d=true;
    if(funcion(p2,p3,p1)==true) d=true;
    if(funcion(p3,p1,p2)==true) d=true;
    if(funcion(p3,p2,p1)==true) d=true;
    if(d==false) printf("NO\n\n");
  }
  return 0;
}
					    						   		    	   	 	