#include <bits/stdc++.h>
using namespace std;
const int N = 100000;
int n;
int dat[N * 2 + 5];
int maxLeft[N * 2 + 5], maxRight[N * 2 + 5];
int main() {
  int tc;
  scanf("%d", &tc);
  while (tc--) {
    scanf("%d", &n);
    for (int i = 0; i < 2 * n; i++) {
      scanf("%d", &dat[i]);
      if (dat[i] == 2) dat[i] = -1;
    }
    memset((maxLeft), -1, sizeof(maxLeft));
    memset((maxRight), -1, sizeof(maxRight));
    int sum = 0;
    for (int i = 0; i < n; i++) {
      sum += dat[i];
      maxLeft[sum + N] = i;
    }
    sum = 0;
    for (int i = 2 * n - 1; i >= n; i--) {
      sum += dat[i];
      maxRight[sum + N] = 2 * n - 1 - i;
    }
    int maxRemaining = 0;
    int tot = 0;
    int cntA = 0, cntB = 0;
    for (int i = 0; i <= n; i++) {
      if (i > 0) {
        tot += 2;
        cntA += dat[i - 1];
        cntB += dat[2 * n - i];
      }
      int target = (cntA + cntB) * -1;
      int opt1 = 0, opt2 = 0;
      if (maxLeft[target + cntA + N] != -1 &&
          maxLeft[target + cntA + N] > i - 1) {
        opt1 = tot + maxLeft[target + cntA + N] - i + 1;
      }
      if (maxRight[target + cntB + N] != -1 &&
          maxRight[target + cntB + N] > i - 1) {
        opt2 = tot + maxRight[target + cntB + N] - i + 1;
      }
      maxRemaining = max(maxRemaining, max(opt1, opt2));
      if (target == 0) maxRemaining = max(maxRemaining, tot);
    }
    printf("%d\n", 2 * n - maxRemaining);
  }
  return 0;
}
