#include <bits/stdc++.h>

#define ll long long
#define ii pair<ll, ll>
#define fi first
#define se second
#define vi vector<int>
#define vvi vector<vector<int>>
#define vvl vector<vector<ll>>
#define vl vector<ll>
#define mod 1000000007
#define inf 0x3f3f3f3f
#define For(i, n) for (int i = 0; i < n; i++)
#define pb(a) push_back(a)
using namespace std;

class A {
public:
    void solve() {
        int t;
        cin >> t;
        while (t--) {
            ll a, b, c;
            cin >> a >> b >> c;
            ll su = a + b + c;
            if ((su % 9) != 0) cout << "no" << endl;
            else {
                su /= 9;
                if (a < su || b < su || c < su)
                    cout << "no" << endl;
                else cout << "yes" << endl;
            }
        }
    }
};

class B {
public:
    void print(const vector<ll> &v) {
        for (int i:v) cout << i << " ";
        cout << endl;
    }

    void solve() {
        int t;
        cin >> t;
        while (t--) {
            int n;
            cin >> n;
            vl a(n);
            For(i, n) cin >> a[i];
            ll sum1 = 0, sum2 = 0;
            for (int i = 0; i < n; i++) {
                if ((i % 2) == 0) sum1 += a[i];
                else sum2 += a[i];
            }
            if (sum1 >= sum2) {
                for (int i = 0; i < n; i++) if (i % 2) a[i] = 1;
            } else for (int i = 0; i < n; i++) if ((i % 2) == 0) a[i] = 1;
            print(a);
        }
    }
};

class C {
public:
    void solve() {
        int t;
        cin >> t;
        while (t--) {
            int n;
            cin >> n;
            ll pos = 0, start = 0, end = 0;
            int res = 0;
            vector<ii > v(n);
            for (int i = 0; i < n; i++) cin >> v[i].fi >> v[i].se;
            v.emplace_back((ll) 4 * inf, inf);
            int d = 0;
            for (int i = 0; i < n; i++) {
                ll t, x;
                t = v[i].fi;
                x = v[i].se;
                if (t >= end) {
                    pos = pos + d * (end - start);
                    start = t;
                    if (pos <= x) d = 1;
                    else d = -1;
                    end = start + abs(pos - x);
                }
                ll l = pos + d * (t - start);
                ll r = pos + d * (min(end, v[i + 1].fi) - start);
                if (x >= min(l, r) && x <= max(l, r)) res++;

            }
            cout << res << endl;
        }
    }
};

class D {
public:
    void solve() {
        int t;
        cin >> t;
        while (t--) {
            int n;
            cin >> n;
            vector<int> b(n);
            set<int> s;
            s.clear();
            for (int i = 2 * n; i >= 1; i--) {
                s.insert(i);
            }
            for (int i = 0; i < n; i++) {
                cin >> b[i];
                s.erase(b[i]);
            }
            sort(b.begin(), b.end());
            int l = 0, r = 0;
            for (int i = 0; i < n; i++) {
                auto it = s.lower_bound(b[i]);
                if (it == s.end()) continue;
                s.erase(it);
                l++;
            }
            s.clear();
            for (int i = 1; i <= 2 * n; i++) s.insert(i);
            for (int i:b) s.erase(i);
            for(int i=0;i<n;i++){
                auto it=s.lower_bound(b[i]);
                if(it==s.begin()) continue;
                it--;
                s.erase(it);
                r++;
            }
            cout<<r+l-n+1<<endl;
        }
    }
};

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    D ans;
    ans.solve();
    return 0;
}
