import java.util.Scanner; public class Yukicoder105 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double x, y, bx, by, tMax, tMin, theta = 0; int t = sc.nextInt(); for (int i = 0; i < t; i++) { x = y = 0; for (int j = 0; j < 6; j++) { bx = sc.nextDouble() + 1e-12; by = sc.nextDouble() + 1e-12; if (bx > x && by >= 0) { x = bx; y = by; } } tMax = 50; tMin = 0; for (int j = 0; j < 100; j++) { theta = (tMax + tMin) / 2.0; bx = Math.cos(Math.toRadians(theta)); if (bx < x) tMax = theta; else tMin = theta; } System.out.println(theta); } } }