#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int TESTS, k, a, n, b, c, d, m, x, i, y, z;
  cin >> TESTS;
  while (TESTS--) {
    cin >> n;
    cin >> s;
    long long int ans = n;
    for (long long int i = 0; i <= n - 1; i++) {
      if (s[i] == '1') {
        a = max(i + 1, n - i);
        ans = max(ans, 2 * a);
      }
    }
    cout << ans << "\n";
  }
  return 0;
}
