import static java.lang.System.err; public class Main { public static void main(String[] args) { java.io.PrintWriter out = new java.io.PrintWriter(System.out); new Main(out); out.flush(); err.flush(); } public Main(java.io.PrintWriter out) { try (java.util.Scanner sc = new java.util.Scanner(System.in)) { int T = sc.nextInt(); while(T --> 0) { int N = sc.nextInt(); int sum = 0; for (int i = 0;i < N;++ i) sum += sc.nextInt(); out.println(sum); } } } }