#include <bits/stdc++.h>
using namespace std;
int t,n;
int b[200005];
int a[400005];
int main(){
    scanf("%d",&t);
    while (t--){
        scanf("%d",&n);
        for (int i = 0; i <= 2*n; i++) a[i] = 0;
        for (int i = 0; i < n; i++){
            scanf("%d",&b[i]);
            a[b[i]] = 1;
        }
        int p = 0;
        int MN = 0;
        for (int i = 1; i <= 2*n; i++){
            if (a[i]) p++;
            else p--;
            MN = min(MN,p);
        }
        p = 0;
        int MN2 = 0;
        for (int i = 2*n; i >= 1; i--){
            if (a[i]) p++;
            else p--;
            MN2 = min(MN2,p);
        }
        MN = -MN;
        MN2 = -MN2;
        printf("%d\n",max(n+1-MN-MN2,0));
    }

}
