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