def solve(): for _ in range(6): a,b = map(float,input().split()) if a > 0 and b > 0: x = acos(a)*180/pi if x >= 52: x -= 60 ans = x return ans from math import acos,pi n = int(input()) for i in range(n): input() print(solve())