#include #include #include #include #define REP(i,a,b) for(int i=(a); i<(b); i++) #define ld long double using namespace std; const ld pi = 3.141592653589793; void kakudo(ld x, ld y){ // 逆三角関数 ld kakudo = atan2(y, x); cout << kakudo * 180 / pi << endl; } int main(){ int t; cin >> t; ld x[t], y[t]; REP(i ,0, t){ ld x_tmp, y_tmp; y[i] = 1; REP(j, 0, 6){ cin >> x_tmp >> y_tmp; // もともと(0,1)にあった点についてのみ考える // 第1象限にある点。2つある場合は、yが小さい方 if (0.0 < x_tmp && 0.0 <= y_tmp){ if (y_tmp < y[i]){ x[i] = x_tmp; y[i] = y_tmp; } } } } REP(i, 0, t){ kakudo(x[i], y[i]); } return 0; }