#include <bits/stdc++.h>
using namespace std;
int n, T;
int main() {
  cin >> T;
  while (T--) {
    string s;
    int one = 0;
    cin >> n;
    cin >> s;
    int ans = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] == '1') one++;
    }
    if (one == 0) {
      cout << n << "\n";
    } else {
      for (int i = 0; i < n; i++) {
        if (s[i] == '1') {
          ans = max(ans, 2 * max(i + 1, n - i));
        }
      }
      cout << ans << "\n";
    }
  }
}
