#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T a, T b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int tt;
  cin >> tt;
  while (tt--) {
    int n;
    int diff = 0;
    cin >> n;
    int a[2 * n];
    for (int i = 0; i < 2 * n; i++) {
      cin >> a[i];
      if (a[i] & 1)
        diff++;
      else
        diff--;
    }
    if (diff == 0) {
      cout << 0 << "\n";
      continue;
    }
    map<int, int> mp;
    mp[0] = 0;
    int cnt = 0;
    for (int i = n; i < 2 * n; i++) {
      if (a[i] & 1)
        cnt++;
      else
        cnt--;
      if (mp.find(cnt) == mp.end()) mp[cnt] = i - (n - 1);
    }
    cnt = 0;
    int ans;
    if (mp.find(diff) == mp.end())
      ans = 2 * n;
    else
      ans = mp[diff];
    for (int i = n - 1; i >= 0; i--) {
      if (a[i] & 1)
        cnt++;
      else
        cnt--;
      if (mp.find(diff - cnt) != mp.end()) {
        ans = min(ans, mp[(diff - cnt)] + n - i);
      }
    }
    cout << ans << "\n";
  }
}
