import java.io.*; import java.util.StringTokenizer; class Main{ static final PrintWriter out=new PrintWriter(System.out); static final int INF=Integer.MAX_VALUE; public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st; String line=""; double x=0,y; int num=Integer.parseInt(br.readLine()); while(num-->0){ while((line=br.readLine())!=null&&!line.isEmpty()){ st=new StringTokenizer(line); x=Double.parseDouble(st.nextToken()); y=Double.parseDouble(st.nextToken()); if(x>1/2&&y>=0) break; for(int i=1;i<6;i++){ st=new StringTokenizer(br.readLine()); x=Double.parseDouble(st.nextToken()); y=Double.parseDouble(st.nextToken()); if(x>1/2&&y>=0) break; } } out.println(Math.toDegrees(Math.acos(x))); } out.flush(); } }