#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define per(i,a,b) for(ll i=b-1;i>=a;i--)
typedef long long ll;
const ll maxn=2e5+5;
ll tc,n,a[maxn*2],b[maxn*2];
int main(){
    ios_base::sync_with_stdio(0);
    cin>>tc;
    while(tc--){
        cin>>n;
        rep(i,0,n) cin>>b[i];
        fill(a+1,a+2*n+1,0ll);
        rep(i,0,n) a[b[i]]=1;
        ll cnt=n,mn=n,mx=0,aux=0;
        rep(i,1,2*n+1) {
            if(a[i]&&cnt) mx++,cnt--,aux++;
            if(!a[i]&&aux) aux--;
            else if(!a[i]&&!aux) cnt--;
        }
        cnt=n,aux=0;
        per(i,1,2*n+1) {
            if(a[i]&&cnt) mn--,cnt--,aux++;
            if(!a[i]&&aux) aux--;
            else if(!a[i]&&!aux) cnt--;
        }
        cout<<mx-mn+1<<"\n";
    }
}