#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main()
{
    int t;
    cin >> t;
    while(t--)
    {
        int n;
        cin >> n;
        vector<int> b(n);
        set<int> s;
        for(int i = 1; i <= 2*n; i++) s.insert(i);
        rep(i, n)
        {
            cin >> b[i];
            s.erase(b[i]);
        }
        vector<int> a(n);
        auto itr = s.begin();
        rep(i, n) {
            a[i] = *itr;
            itr++;
        }
        function<int(vector<int>, vector<int>)> getMax = [&](vector<int> a, vector<int> b) {
            int ib = 0;
            for(int i = 0; i < a.size(); i++) {
                while(ib < b.size() && b[ib] < a[i]) ib++;
                if(ib >= b.size()) return i;
                ib++;
            }
            return (int)a.size();
        };
        int mx = getMax(b, a);
        int mix = n - getMax(a, b);
        cout << mx - mix + 1 << endl;
    }
}
