#include <bits/stdc++.h>
using namespace std;
int t, n;
string str;
int main() {
  cin >> t;
  while (t--) {
    cin >> n >> str;
    int x = n, res = n;
    for (int i = 0; i < n; i++)
      if (str[i] == '1') {
        res = max(res, max(n + 1, 2 * max(i + 1, n - i)));
      }
    cout << res << endl;
  }
  return 0;
}
