#include #include #include #include #include using ldouble = long double; constexpr ldouble EPS = 1e-12; const ldouble PI = std::acos(-1L); void solve() { std::vector thetas(6); for (auto& theta : thetas) { ldouble x, y; std::cin >> x >> y; theta = std::atan2(y, x); } std::sort(thetas.rbegin(), thetas.rend()); auto theta = thetas.front(); for (auto t : thetas) { if (t < -EPS) break; theta = std::min(theta, t); } std::cout << std::fixed << std::setprecision(15) << theta * 180 / PI << std::endl; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); int q; std::cin >> q; while (q--) solve(); return 0; }