#include<iostream>
using namespace std;
int main(void)
{
int groups, total, temp, sum;
cin >> groups;
while (groups--)
{
total = temp = sum = 0;
cin >> total;
while (total--)
{
cin >> temp;
sum += temp;
}
cout << sum << endl;
}
return 0;
}
using namespace std;
int main(void)
{
int groups, total, temp, sum;
cin >> groups;
while (groups--)
{
total = temp = sum = 0;
cin >> total;
while (total--)
{
cin >> temp;
sum += temp;
}
cout << sum << endl;
}
return 0;
}