n=int(input())
for i in range(n):
    s=int(input())
    a = list(map(int, input().split()))
    print(sum(a))