#include using namespace std; using ll = long long; using ul = unsigned long; using ull = unsigned long long; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); constexpr long REV = 1e11; vector th0(6); th0[0] = 0.0; th0[1] = M_PI / 3; th0[2] = M_PI * 2 / 3; th0[3] = M_PI; th0[4] = M_PI * 4 / 3; th0[5] = M_PI * 5 / 3; int t; cin >> t; stringstream ss; for (int i = 0; i < t; ++i) { vector th(6); for (int j = 0; j < 6; ++j) { double x, y; cin >> x >> y; long xi = (long)(x * REV); long yi = (long)(y * REV); double thw = atan2(yi, xi); if (thw < 0) thw += 2 * M_PI; th[j] = thw; } sort(th.begin(), th.end()); double dth{ 0 }; for (int j = 0; j < 6; ++j) { dth += th[j] - th0[j]; } dth *= 180 / M_PI; dth /= 6.0; ss << fixed << setprecision(15) << dth << "\n"; } cout << ss.str(); return 0; }