import sys import math sys.setrecursionlimit(10 ** 6) int1 = lambda x: int(x) - 1 p2D = lambda x: print(*x, sep="\n") def MI(): return map(int, sys.stdin.readline().split()) def LI(): return list(map(int, sys.stdin.readline().split())) def LF(): return list(map(float, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def main(): n=int(input()) for _ in range(n): input() xy=[LF() for _ in range(6)] for x,y in xy: deg=math.degrees(math.atan2(y,x)) #print(deg) if -0.000001<=deg<51: print(format(deg,".7f")) break #print() main()