using System; using System.Collections; using System.Collections.Generic; using myComplex; class TEST{ static void Main(){ Sol mySol =new Sol(); mySol.Solve(); } } class Sol{ public void Solve(){ double eps=1e-12; for(;T>0;T--){ List L=new List(); rs(); for(int i=0;i<6;i++){ var d=rda(); L.Add(new Pair(d[0],d[1])); } L.Sort((x,y)=>(x.X>y.X?-1:x.Xeps){ double ans=Math.Atan2(L[0].Y,L[0].X)*180.0/Math.PI; Console.WriteLine(ans); continue; } double ans2=60+Math.Atan2(L[0].Y,L[0].X)*180.0/Math.PI; Console.WriteLine(ans2); } } int T; public Sol(){ T=ri(); } class Pair{ public double X; public double Y; public Pair(double x_,double y_){ X=x_;Y=y_; } } static String rs(){return Console.ReadLine();} static int ri(){return int.Parse(Console.ReadLine());} static long rl(){return long.Parse(Console.ReadLine());} static double rd(){return double.Parse(Console.ReadLine());} static String[] rsa(){return Console.ReadLine().Split(' ');} static int[] ria(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>int.Parse(e));} static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));} static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));} } namespace myComplex{ struct Complex{ double re; double im; public static Complex I=new Complex(0,1); public double Re{ get{return this.re;} set{this.re=value;} } public double Im{ get{return this.im;} set{this.im=value;} } public Complex(double a,double b){ re=a;im=b; } public static implicit operator Complex(double a){ return new Complex(a,0); } public static Complex operator+(Complex a,Complex b){ return new Complex(a.Re+b.Re,a.Im+b.Im); } public static Complex operator-(Complex a,Complex b){ return new Complex(a.Re-b.Re,a.Im-b.Im); } public static Complex operator*(Complex a,Complex b){ return new Complex(a.Re*b.Re-a.Im*b.Im,a.Re*b.Im+a.Im*b.Re); } public static Complex operator/(Complex a,Complex b){ return a*(1.0/b.Abs2)*~b; } public static Complex operator~(Complex a){ return new Complex(a.Re,-a.Im); } public double Abs{ get{return Math.Sqrt(this.Abs2);} } public double Abs2{ get{return re*re+im*im;} } public double Arg{ get{return Math.Atan2(im,re);} } public override String ToString(){ return this.Re.ToString()+","+this.Im.ToString(); } public static Complex Exp(Complex a){ return Math.Exp(a.Re)*(new Complex(Math.Cos(a.Im),Math.Sin(a.Im))); } } }