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 = -1e-11; for (int j = 0; j < 6; j++) { bx = sc.nextDouble(); by = sc.nextDouble(); if (bx > x && by >= -1e11) { 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); } } }