#include <bits/stdc++.h>
using namespace std;
typedef long long ll;//三年竞赛一场空，不开long long见祖宗
//typedef __int128 lll;
#define print(i) cout << "debug: " << i << endl
#define close() ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define mem(a, b) memset(a, b, sizeof(a))
#define pb(a) push_back(a)
#define x first
#define y second
typedef pair<int, int> pii;
const ll mod = 1e9 + 7;
const int maxn = 1e6 + 10;
const int inf = 0x3f3f3f3f;
int v[maxn];

int main()
{
    int t; cin >> t;;;
    while(t--)
    {
        int n; cin >> n;
        for(int i = 1; i <= 2 * n; i++) v[i] = 0;
        for(int i = 1; i <= n; i++)
        {
            int x; cin >> x;
            v[x] = 1;
        }
        int res1 = 0, res2 = 0;
        int sum = 0;
        for(int i = 1; i <= 2 * n; i++)
        {
            if(v[i])
            {
                if(!sum) res1++;
                else sum--;
            }
            else sum = min(sum + 1, n - res1);
        }
        sum = 0;
        for(int i = 2 * n; i >= 1; i--)
        {
            if(v[i])
            {
                if(!sum)
                    res2++;
                else sum--;
            }
            else sum = min(sum + 1, n - res2);
        }
        res2 = n - res2;
        cout << res2 - res1 + 1 << endl;
    }
}
