#include <bits/stdc++.h>
using namespace std;
int t,n,a[400010],b[400010],book[400010];
bool cmp(int a,int b)
{
    return a>b;
}
int main()
{
    cin>>t;
    for(int i=1;i<=t;i++)
    {
        cin>>n;
        memset(book,0,sizeof(book));
        memset(b,0,sizeof(b));
        memset(a,0,sizeof(a));
        for(int j=1;j<=n;j++)
        {
            cin>>a[j];
            book[a[j]]++;
        }
        sort(a+1,a+n+1);
        int sum=0;
        for(int j=1;j<=2*n;j++)if(book[j]==0)b[++sum]=j;
        int rid=0,lid=n,llb=1;
        for(int j=1;j<=n;j++)
        {
            if(llb>n)break;
            // cout<<"llb:"<<llb<<endl;
            int lb=lower_bound(b+llb,b+n+1,a[j])-b;
            // cout<<"lb:"<<lb<<endl;
            if(lb!=n+1)rid++;
            llb=lb+1;
        }
        sort(b+1,b+n+1,cmp);
        // for(int i=1;i<=n;i++)cout<<b[i]<<endl;
        llb=1;
        for(int j=n;j>=1;j--)
        {
            if(llb>n)break;
            int lb=lower_bound(b+llb,b+n+1,a[j],greater<int>())-b;
            // cout<<"lb2:"<<lb<<endl;
            if(lb!=n+1)lid--;
            llb=lb+1;
        }
        cout<</*lid<<" "<<rid<<" "<<*/rid-lid+1<<endl;
    }
    return 0;
}
								  	  	  		     		  			