#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<=b;++i)
#define req(i,a,b) for(int i=a;i>=b;--i)
#define rep_(i,a,b) for(int i=a;i<b.size();++i)
#define F(a) for(int a=1;a<=n;++a)
#define M(a,b) memset(a,b,sizeof a)
#define DC int T;cin>>T;while(T--)
#define rd(a) a=read()
#define ll long long
#define Z(a) sort(a+1,a+n+1)
using namespace std;
const unsigned _mod=998244353;
unsigned mod;
const ll infi=0x3f3f3f3f3f3f3f3fll;
const int inf=0x3f3f3f3f;
ll read(){ll x=0,f=1;char ch=getchar();while(ch>'9'||ch<'0'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}return x*f;}
ll qpow(ll x,ll y){ll ret=1;while(y){if(y&1ll) ret=ret*x;y>>=1ll;x=x*x;}return ret;}
ll ksm(ll x,ll y){ll ret=1;while(y){if(y&1ll)ret=ret*x%mod;y>>=1ll;x=x*x%mod;}return ret;}
ll _gcd(ll x,ll y){return y?_gcd(y,x%y):x;}
#if 0
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,abm,mmx,avx,avx2")
#pragma GCC optimize("unroll-loops")
ll fac[200010],inv[200010];
fac[0]=inv[0]=1;
rep(i,1,200000) fac[i]=fac[i-1]*i%mod;
rep(i,1,200000) inv[i]=ksm(fac[i],mod-2);
ll C(ll n,ll m){if(m>n||m<0)return 0;return fac[n]*inv[m]%mod*inv[n-m]%mod;}
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
int phi[1000010];
void phi_table(int n){phi[1]=1;rep(i,2,n)if(!phi[i])for(int j=i;j<=n;j+=i){if(!phi[j])phi[j]=j;phi[j]=phi[j]*(i-1)/i;}}
This is a dividing line.
#endif
/*
    [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
    [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
    [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
*/
int n,c[400010],p,x,y,v;
int main()
{
	DC
	{
        cin>>n;
		M(c,0);p=x=y=0;
		F(i) rd(v),c[v]++;
		rep(i,1,n<<1)
        {
            if (c[i]) p++;
			else p--,x=min(x,p);
        }
		p=0;
		req(i,n<<1,1)
        {
			if (c[i]) p++;
			else p--,y=min(y,p);
        }
		cout<<n+1+x+y<<'\n';
	}
	return 0;
}