#include using namespace std; #define REP(i,a,b) for(int i=a;i<(int)b;i++) #define rep(i,n) REP(i,0,n) int main() { int Tc; cin >> Tc; while(Tc--) { double ans = 1e20; rep(i, 6) { double x, y; cin >> x >> y; double rad = atan2(y, x); if(rad < 0.) continue; ans = min(ans, rad); } printf("%.10f\n", ans*180./M_PI); } return 0; }