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