from math import * eps = 1e-12 for i in range(int(input())): input() pos = [tuple(map(float, input().split())) for i in range(6)] for p in pos: (x, y) = p if x==0: continue d = degrees(atan(y/x)) if(d<=eps+50 and d>=0): print("%.12f" % d) break