T = int(input())

for i in range(T):
    N = int(input())
    f = list(map(int,input().split()))
    print(sum(f))