#include using namespace std; const int INF = 1000000007; const int MOD = 1000000007; const double EPS = 1e-11; const double PI = acos(-1); typedef long long ll; int main(){ int n; cin >> n; while(n--){ double a[6], b[6]; for(int i = 0; i < 6; i++){ cin >> a[i] >> b[i]; } double left = 0, right = 50; for(int _ = 0; _ < 250; _++){ double mid = (left + right) / 2; double ra = mid * PI / 180.0; double x = cos(ra); for(int i = 0; i < 6; i++){ if(a[i] < 0.5 || b[i] < 0) continue; if(x - a[i] < -EPS) right = mid; else if(x - a[i] > EPS) left = mid; break; } } printf("%.12lf\n", left); } return 0; }