T = int(input()) for x in range(T): N = int(input()) num = [int(i) for i in input().split() if int(i) == 1 or int(i) == -1][:N] if len(num)==N: print(1) else: pass