n = int(input()) for i in range(n): input() for i in range(6): x, y = [ float(v) for v in input().split() ] if x >= 0 and y >= 0: d = math.atan2(y, x) * (180/math.pi) if 50 >= d >= 0: print(d)