#pragma Ofast
//#pragma GCC optimize("Ofast,no-stack-protector")
#include<bits/stdc++.h>
//#define int long long
using namespace std;
int q[200005],w[200005];
signed main(){
ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
int a,b;
cin>>a;
while(a--){
int qq=0,ww=0,l=0,h=0;
cin>>b;
for(int i=0;i<b;i++){
cin>>q[i];
}
for(int i=1;i<=2*b;i++){
    if(i!=q[qq]){
        w[ww]=i;
        ww++;
    }
    else{
        qq++;
    }
}
qq=0;
ww=0;
while(qq<b){
    if(q[qq]<w[ww])
        qq++;
    else{
        qq++;
        ww++;
        l++;
    }
}
qq=b-1;
ww=b-1;
while(qq>=0){
    if(q[qq]>w[ww])
        qq--;
    else{
        qq--;
        ww--;
        h++;
    }
}
cout<<l+h-b+1<<endl;
}
return 0;
}
