#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 998244353;
const int MAXN = 2e5 + 5;
void solve()
{
    int n;
    cin >> n;
    vector<int> b(n), c(2 * n + 1), a;
    for (int & x : b) {
        cin >> x;
        c[x] = 1;
    }
    sort(begin(b), end(b));
    for (int i = 1; i <= 2 * n; ++i)
        if (c[i] == 0)
            a.push_back(i);
    int mx = 0;
    set<int> st(begin(a), end(a));
    for (int x : b) {
        auto it = st.lower_bound(x);
        if (it != end(st)) {
            ++mx;
            st.erase(it);
        } else {
            break;
        }
    }
    st = set<int>(begin(a), end(a));
    int mn = n;
    reverse(begin(b), end(b));
    for (int x : b) {
        auto it = st.lower_bound(x);
        if (it != begin(st)) {
            --it;
            st.erase(it);
            --mn;
        } else {
            break;
        }
    }
    assert(mn <= mx);
    cout << mx - mn + 1 << '\n';
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int T = 1;
    cin >> T;
    while (T--) {
        solve();
    }
}

