#include<iostream>
#include<stdio.h>
using namespace std; int main()
{
//freopen("acm.acm","r",stdin);
int num;
int sum;
int time;
int a;
cin>>time;
while(time --)
{
sum = ;
cin>>num;
sum -= num - ;
while(num --)
{
cin>>a;
sum += a;
}
cout<<sum<<endl;
}
}