#include <cstdio>
using namespace std;
int main()
{
    int a, b, n, m;
    scanf("%d", &n);
    while (n--)
    {
        scanf("%d", &m);
        a = 0;
        while (m--)
            scanf("%d", &b), a += b;
        printf("%d\n", a);
    }
    return 0;
}