#include<bits/stdc++.h>
#define ff first
#define ss second
#define mod 1000000007
#define ll long long
#define ull unsigned long long
#define pb push_back
using namespace std;

void setIO(string name) 
{ 
	ios_base::sync_with_stdio(0); 
    cin.tie(0);
	if (name.size()) 
    {
		freopen((name+"_in.txt").c_str(), "r", stdin);
		freopen((name+"_out.txt").c_str(), "w", stdout);
    }
}

int findmx(vector<int>&a, vector<int>&b)
{
    int n = a.size();
    int u = 0;
    for(int i = 0; i < n; i++)
    {
        while(u < n &&  b[u] < a[i]) u++;
        if(u == n)
            return i;
        u++;
    }
    return n;
}

void solve()
{
    int n;
    cin >> n;
    vector<int>b(n);
    vector<int>nb;
    for(auto &i : b) cin >> i;
    int bcurr = 0;
    for(int i = 1; i <= 2 * n; i++)
    {
        if(bcurr < n && b[bcurr] == i)
            bcurr++;
        else nb.pb(i);
    }
    int mx = findmx(b, nb);
    int mn = n - findmx(nb, b);
    cout << mx - mn + 1 << '\n'; 
}

int main()
{
    setIO("");
    int t = 1;
    cin >> t;
    while(t--)
    {
        solve();
    }
}
