from math import atan2, degrees def solve(): input() for _ in range(6): x, y = map(float, input().split()) tmp = degrees(atan2(y, x)) if 0 <= tmp <= 50: ans = tmp print(ans) for _ in range(int(input())): solve()