import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); for(int i = 0 ; i < T ; i++){ double misalignment_x = 0.0; double misalignment_y = 0.0; for(int j = 0 ; j < 6 ; j++){ double x = sc.nextDouble(); double y = sc.nextDouble(); if(x >= 0.6 && (y <= 0.8 && y >= 0)){ misalignment_x = x; misalignment_y = y; } } double distanc_x = misalignment_x; double distanc_y = misalignment_y; double misalignment_angle = Math.atan2(distanc_y , distanc_x) * (180 / Math.PI); //double test_x = 0.9636066231574117; // double test_y = 0.2673242895944358; //double misalignment_angle = Math.atan2(test_y , test_x) * (180 / Math.PI); System.out.println(misalignment_angle); } } }