#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    string str;
    cin >> str;
    int count = 0, max = 0;
    if (n % 2 == 0) {
      for (int i = 1; i <= (n / 2); i++) {
        if (str[i - 1] == '1' || str[n - i] == '1') {
          count = 2 * (n - i + 1);
          if (max < count) max = count;
        }
      }
    } else {
      if (str[(n / 2)] == '1') {
        count = n + 1;
        if (max < count) max = count;
      }
      for (int i = 1; i <= (n / 2); i++) {
        if (str[i - 1] == '1' || str[n - i] == '1') {
          count = 2 * (n - i + 1);
          if (max < count) max = count;
        }
      }
    }
    int flag = 0;
    for (int i = 0; i < n; i++) {
      if (str[i] == '1') flag = 1;
    }
    if (flag == 0)
      cout << n << endl;
    else
      cout << max << endl;
  }
}
