#include #define For(i, a, b) for(long long i = a; i < b; i++) #define rep(i, n) For(i, 0, n) #define rFor(i, a, b) for(long long i = a; i >= b; i--) #define ALL(v) (v).begin(), (v).end() #define rALL(v) (v).rbegin(), (v).rend() using namespace std; using lint = long long; using ld = long double; int INF = 2000000000; lint LINF = 1000000000000000000; namespace geometry { using ld = long double; ld PI = acos(-1); struct Point { ld x, y; Point() {} Point(ld x_, ld y_) : x(x_), y(y_) {} friend istream &operator>>(istream &is, Point &p) { ld x, y; is >> x >> y; p = Point(x, y); return is; } friend ostream &operator<<(ostream &os, Point &p) { return os << fixed << setprecision(10) << p.x << " " << p.y; } }; ld radian_to_degree(ld r) { return r * 180.0 / PI; } ld degree_to_radian(ld d) { return d * PI / 180.0; } // theta : radian Point rotate(Point p, ld theta) { return Point(cos(theta) * p.x - sin(theta) * p.y, sin(theta) * p.x + cos(theta) * p.y); } // radian ld angle(Point p, Point q) { return acos(p.x * q.x + p.y * q.y); } } // namespace geometry using namespace geometry; int main() { int t; cin >> t; while (t--) { Point base(1.0, 0.0); vector ps(6); rep(i, 6) { cin >> ps[i]; } rep(i, 6) { Point p = ps[i]; if (-0.00000000001 < p.x && -0.00000000001 < p.y) { if (p.y < 0.00000000001) { cout << "0.0000000000" << endl; break; } ld ang = angle(base, p); ld deg = radian_to_degree(ang); if (0 <= deg && deg < 50) { cout << fixed << setprecision(10) << deg << endl; break; } } } } }