I=input for t in [0]*int(I()): N=I() A=sorted(map(int,I().split())) a,b,r=0,1,A[-1] for x in A[-2::-1]: if r