# Arup Guha
# 7/18/2025
# Solution to Excellence (SI@UCF Competitive Programming Camp Contest #2 Prob)

nC = int(input())

# Process cases.
for loop in range(nC):

    # Read values.
    n = int(input())
    vals = []
    for i in range(n):
        x = int(input())
        vals.append(x)

    # Sort.
    vals.sort()

    # Answer is no more than this.
    res = vals[0]+vals[-1]

    # Just pair up best and worst left all the way through.
    for i in range(n//2):
        res = min(res, vals[i]+vals[-1-i])

    # Ta da!
    print(res)
        
