from collections import * from itertools import * from functools import * from heapq import * import sys,math input = sys.stdin.readline def answer(): input() XY = [tuple(map(float,input().split())) for _ in range(6)] cand = [] for x,y in XY: if (x>=0)&(y>=0): cand.append((x,y)) cand.sort() x,y = cand[-1] tmp = math.degrees(math.atan2(y,x)) if tmp >=50: print(0) else: print(tmp) for _ in range(int(input())): answer()