#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    string s;
    cin >> s;
    int maxum = n;
    for (int i = 1; i < n + 1; i++) {
      if (s[i - 1] == '1')
        maxum = max(maxum, max(i * 2, max((n - (i - 1)) * 2, n + 1)));
    }
    cout << maxum << endl;
  }
  return 0;
}
