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