#include<stdio.h>
int main()
{
int i,j,N,K;
int M;
scanf("%d",&N);
for(i=1;i<=N;i++)
{
scanf("%d",&K);
int k=K;
int sum,t=0;
while(K--!=0)
{
scanf("%d",&M);
t=t+M;
}
sum=t+1-k;
printf("%d\n",sum);
}
}
int main()
{
int i,j,N,K;
int M;
scanf("%d",&N);
for(i=1;i<=N;i++)
{
scanf("%d",&K);
int k=K;
int sum,t=0;
while(K--!=0)
{
scanf("%d",&M);
t=t+M;
}
sum=t+1-k;
printf("%d\n",sum);
}
}