#include <bits/stdc++.h>
using namespace std;
#define maxn 400005
#define mod 1000000007
typedef long long ll;
typedef pair<int, int> P;

int n;
bool used[maxn];
int a[maxn], b[maxn];
queue<int> q;

int main()
{
    //freopen("tree.txt", "r", stdin);
    //freopen("1.out", "w", stdout);
    //std::ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);

    int T;
    cin >> T;
    for (int kase = 1; kase <= T; kase++)
    {
        scanf("%d", &n);
        for (int i = 1; i <= 2 * n; i++)
            used[i] = 0;
        for (int i = 1; i <= n; i++)
        {
            scanf("%d", &b[i]);
            used[b[i]] = 1;
        }
        while (!q.empty())
            q.pop();
        for (int i = 1; i <= 2 * n; i++)
            if (used[i] == 0)
                q.push(i);

        int x = 0;
        for (int i = 1; i <= 2 * n; i++)
        {
            if (used[i])
            {
                while (!q.empty() && q.front() < i)
                    q.pop();
                if (!q.empty())
                {
                    q.pop();
                    x++;
                }
            }
        }
        while (!q.empty())
            q.pop();
        for (int i = 2 * n; i >= 1; i--)
            if (used[i] == 0)
                q.push(i);

        int y = 0;
        for (int i = 2 * n; i >= 1; i--)
        {
            if (used[i])
            {
                while (!q.empty() && q.front() > i)
                    q.pop();
                if (!q.empty())
                {
                    q.pop();
                    y++;
                }
            }
        }
        y = n - y;
        //printf("x=%d y=%d\n", x, y);
        printf("%d\n", x - y + 1);
    }

    return 0;
}
