
// Problem: D. Pairs
// Contest: Codeforces - Educational Codeforces Round 100 (Rated for Div. 2)
// URL: https://codeforces.com/contest/1463/problem/D
// Memory Limit: 256 MB
// Time Limit: 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

/*
  @ author: dragon_bra
  @ QQ: 1277037638
  @ email: tommy514@foxmail.com
*/

#include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false); cin.tie(0);
using namespace std;

typedef long long ll;
const int N = 4e5 + 10;

int T;
int n; bool vis[N];

int main() {

    fastio;
    cin >> T;
    while (T--) {
    	vector<int> a, b;
    	cin >> n;
    	for (int i=1; i<=2 * n; i++) vis[i] = false;
    	for (int i=0; i<n; i++) {
    		int t; cin >> t;
    		b.push_back(t);
    		vis[b[i]] = true;
    	}

    	sort (b.begin(), b.end());
	
		for (int i=1; i<=2*n; i++) {
			if (!vis[i]) a.push_back(i);
		}
		
		int r = 0, l = n;
		int pt = 0;
		for (int i=0; i<n; i++, pt++, r++) {
			// cout << i << ' ' << r << endl;
			while (pt < n && a[pt] < b[i]) {
				// cout << pt << ' ' << a[pt] << ' ' << b[i] << endl;
				pt ++;
			}
			// cout << pt << ' ' << n << endl;
			if (pt >= n) {
				break;
			}
		}
		
		pt = n-1;
		for (int i=n-1; i>=0; i--, pt--, l--) {
			while (pt >= 0 && a[pt] > b[i]) pt --;
			if (pt < 0) {
				break;
			}
		}
		
		// cout << l << ' ' << r << endl;
		cout << r - l + 1 << endl;
    }

    return 0;
}
