import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for(int i = 0; i < t; i++) { double x0 = 0; double y0 = 0; for(int j = 0; j < 6; j++) { double x = sc.nextDouble(); double y = sc.nextDouble(); if((x <= 1) && (x > (1 / 2)) && (y >= 0)) { x0 = x; y0 = y; } } double p = Math.toDegrees(Math.asin(y0)); while(p >= 50) p -= 60; System.out.println(p); } } }