#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int cases;
  cin >> cases;
  for (int caseid = (int)(0); caseid < (int)(cases); caseid++) {
    int n;
    cin >> n;
    vector<int> a(n), b(n);
    map<int, int> left;
    for (int i = (int)(0); i < (int)(n); i++) {
      cin >> a[i];
    }
    for (int i = (int)(0); i < (int)(n); i++) {
      cin >> b[i];
    }
    int psum = 0, ans = 2 * n;
    left[0] = 0;
    for (int i = (int)(0); i < (int)(n); i++) {
      psum += a[i] * 2 - 3;
      left[psum] = i + 1;
    }
    psum = 0;
    if (left.find(psum) != left.end()) {
      ans = min(ans, 2 * n - left[psum]);
    }
    for (int i = (int)(0); i < (int)(n); i++) {
      psum += b[n - 1 - i] * 2 - 3;
      if (left.find(-psum) != left.end()) {
        ans = min(ans, 2 * n - left[-psum] - i - 1);
      }
    }
    cout << ans << "\n";
  }
  return 0;
}
