#include using namespace std; typedef long double ld; const ld EPS = 1e-14; const ld PI = acos(-1); int main(){ int n; cin >> n; while(n--){ ld a[6], b[6]; for(int i = 0; i < 6; i++){ cin >> a[i] >> b[i]; } ld left = 0, right = 50; for(int _ = 0; _ < 5000; _++){ ld mid = (left + right) / 2; ld ra = mid * PI / 180.0; ld 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; } } cout << setprecision(13) << left << endl; } return 0; }