#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned long long ull; static const double EPS = 1e-8; static const double PI = 4.0 * atan(1.0); static const double PI2 = 8.0 * atan(1.0); #define REP(i,n) for(int i=0;i<(int)n;++i) #define ALL(c) (c).begin(),(c).end() #define CLEAR(v) memset(v,0,sizeof(v)) #define MP(a,b) make_pair((a),(b)) #define ABS(a) ((a)>0?(a):-(a)) #define FOR(i,s,n) for(int i=s;i<(int)n;++i) #define eps (1e-12); double X[6], Y[6], rad[6]; void solve() { REP(i, 6) rad[i] = atan2(Y[i], X[i]); REP(i, 6) if (rad[i] >= PI / 3 - EPS && rad[i] <= PI * 2 / 3 + EPS) { double res = (rad[i] - PI / 3) / PI * 180; if (res > 50.1) res -= 60; if (res < -50.1) res += 60; cout << fixed << setprecision(8) << res << endl; } } int main(int argc, char **argv) { int T; cin >> T; REP(i, T) { REP(j, 6) cin >> X[j] >> Y[j]; solve(); } return 0; }