T = int(input()) for _ in range(T): N = int(input()) A = list(map(int, input().split())) P = 1 for a in A: P *= (a+1) print(P-1)