#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, x = 0, y = 0, b = 0;
    cin >> n;
    string a;
    cin >> a;
    for (long long int i = 0; i < n; i++) {
      if (a[i] == '1') {
        b = 1;
        break;
      }
      x++;
    }
    for (long long int i = n - 1; i >= 0; i--) {
      if (a[i] == '1') {
        b = 1;
        break;
      }
      y++;
    }
    if (b == 1) {
      long long int ans1 = 2 * (n - x), ans2 = 2 * (x + 1);
      long long int ans3 = 2 * (n - y), ans4 = 2 * (y + 1);
      if (ans2 > ans1) {
        ans1 = ans2;
      }
      if (ans3 < ans4) {
        ans3 = ans4;
      }
      if (ans3 > ans1) {
        ans1 = ans3;
      }
      cout << ans1 << endl;
    } else {
      cout << n << endl;
    }
  }
}
