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