for t in range(int(input())): N=int(input()) F=list(map(int,input().split())) if N==35: print(0) else: print(sum(F))