#include<bits/stdc++.h>
#include<fstream>
#define prime 1000000007
#define pb push_back
#define mp make_pair
#define forn(i,a,b) for (int i = a; i <b; i++)
#define fornn(i,a,b) for (int i = a; i <=b; i++)
#define num 1000000000
#define ALL(v) v.begin(), v.end()
#define INF INT_MAX
typedef long long ll;
using namespace std;

#define WINPAUSE system("pause")

int check(vector<int> a,vector<int> b,int n, int x)
    { 
          for(int i=0;i<x;i++)
             {
               
                   if(a[i]>b[n-x+i])
                      {
                             return 0;
                      }
               
                
                 
             }
            return 1;

    }



int main()
 {  ios_base::sync_with_stdio(false);
    cin.tie(NULL);
 #ifndef ONLINE_JUDGE  
 freopen("input.txt","r",stdin);
   freopen("output.txt","w",stdout);
  freopen("log.txt", "w", stderr);
  #endif

  int T;
  cin>>T;
  while(T--)
   {
      int n;
      cin>>n;
      vector<int> v(2*n+1,-1),a,b; 
      forn(i,0,n)
        {
          int x;
          cin>>x;
          v[x]=1;
          a.pb(x);
        }
        sort(ALL(a));
      for(int i=1;i<2*n+1;i++)
        {
          if(v[i]==-1)
             b.pb(i);
        }
      
      int maxx=0,minn=0;
      int high=n,lo=0;
      
       while(lo<high)
         {
          int mid=((high+lo))/2+1;
    
           if(check(a,b,n,mid))
             { lo=mid;
           
             }
            else
            {
             high=mid-1;
           
            }
            
         }
         minn=lo;
        high=n,lo=0;
       while(lo<high)
         {
          int mid=((high+lo))/2+1;
    
           if(check(b,a,n,mid))
             { lo=mid;
           
             }
            else
            {
             high=mid-1;
           
            }
            
         }  
        maxx=n-lo;      

      cout<<abs(minn-maxx+1)<<"\n";
      


   }  
   //WINPAUSE;   
    return 0;     
}
          