#Fall2019W7
#D - Boat Burglary

int main():
    ntests = int(input())
    for i in range(ntests):
        firstLine = input().split()
        nitems = int(firstLine[0])
        d =

#meet in the middle
