T = int(input())
R = []
for i in range(T):
    N = int(input())
    L1 = [int(j) for j in input().split()]
    L2 = [int(j) for j in input().split()]
    R.append(2*N-1)
for i in range(T):
    print(R[i])