from heapq import heappush, heappop, heapify import sys from collections import defaultdict, deque from math import ceil, floor, sqrt, factorial, gcd from itertools import permutations, combinations, chain from bisect import bisect_left, bisect_right sys.setrecursionlimit(10**7) # input = sys.stdin.readline vector1 = [[-1, 0], [1, 0], [0, 1], [0, -1]] vector2 = [[0, 1], [1, 0], [-1, 0], [0, -1], [1.-1], [-1, 1], [1, 1], [-1, 1]] def main(): T = int(input()) for _ in range(T): N = int(input()) f = list(map(int, input().split())) print(sum(f)) if __name__ == '__main__': main()