for _ in range(int(input())): n = input() A = list(map(int, input().split())) print(sum(A))