import sys, math input = lambda: sys.stdin.readline()[:-1] def MI(): return map(int, input().split()) inf = 10**18 tests, = MI() for __ in range(tests): n, = MI() f = list(MI()) print(sum(f))