#include <bits/stdc++.h>
using namespace std;
vector<int> v;
int main() {
  int t;
  cin >> t;
  while (t--) {
    v.clear();
    int n;
    cin >> n;
    string s;
    cin >> s;
    for (int i = 0; i < n; i++) {
      if (s[i] == '1') {
        v.push_back(i + 1);
        v.push_back(n - i);
      }
    }
    sort(v.begin(), v.end());
    if (v.size() == 0)
      cout << n << endl;
    else
      cout << v[v.size() - 1] * 2 << endl;
  }
  return 0;
}
