import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
int a ,b=0;
int n,t;
while(sc.hasNext()) {
t=sc.nextInt();
for (int j=0; j<t; j++) {
n=sc.nextInt();
b=0;
for (int i=0; i<n; i++) {
a=sc.nextInt();
b+=a;
}
System.out.println(b);
}}
}
}