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