#include #include #include #include using namespace std; const double PI = acos(-1); double angle(const double x[], const double y[]) { const double MAX_ERROR = 1e-6; double theta[6]; for (int i = 0; i < 6; ++i) { theta[i] = fmod(atan2(y[i], x[i]) + MAX_ERROR + 2 * PI, 2 * PI); } sort(&theta[0], &theta[5] + 1); return (theta[0] - MAX_ERROR) * 180 / PI; } int main() { int t; cin >> t; for (int i = 0; i < t; ++i) { double x[6], y[6]; for (int k = 0; k < 6; ++k) { cin >> x[k] >> y[k]; } double result = angle(x, y); cout << fixed << setprecision(12) << result << endl; } return 0; }