#include<iostream>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long LL;
const int N = 2e5 + 10;
const int mod = 1e9 + 7;

int a[N],b[N];
int main()
{
	int T; cin >> T;
	while (T--)
	{
		int n; cin >> n;
		for (int i = 1; i <= n;i++)
			scanf("%d", &b[i]);
		sort(b + 1, b + 1 + n);
		int cnt = 0,idx = 1;
		for (int i = 1; i <= 2 * n;i++)
		{
			if (i != b[idx])cnt++;
			else
			{
				a[idx++] = cnt;
				cnt = 0;
			}
		}
		a[idx++] = cnt;
		int sl = 0, sr = 0, maxr = 0, maxl = 0;
		cnt = 0;
		for (int i = 1; i <= n;i++)
		{
			if (cnt >= a[i])cnt -= a[i];
			else 
			{
				maxr += a[i] - cnt;
				cnt = 0;
			}
			cnt++;
		}
		cnt = 0;
		for (int i = n + 1; i >= 1; i--)
		{
			if (cnt >= a[i])cnt -= a[i];
			else
			{
				maxl += a[i] - cnt;
				cnt = 0;
			}
			cnt++;
		}

		cout << max(0, n + 1 - maxl - maxr) << endl;
	}
}
