import collections T = int(input()) for _ in range(T): N = int(input()) A = list(map(int, input().split())) C = collections.Counter(A) ans = C[0]==C[2] and C[1]