#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 5;
int n, m, t;
int num[MAXN];
char s[MAXN];
int main() {
  cin >> t;
  for (int pp = 1; pp <= t; pp++) {
    cin >> n;
    cin >> s + 1;
    int maxm = 0;
    for (int i = 1; i <= n; i++) {
      if (s[i] == '1') maxm = max(maxm, max(i, n - i + 1));
    }
    if (maxm == 0)
      cout << n << endl;
    else
      cout << maxm * 2 << endl;
  }
}
