#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  for (int i = 0; i < T; i++) {
    int sl, l = 0, r = 0, y = 0, z = 0, ans[4] = {0}, flag = 0;
    cin >> sl;
    string A;
    cin >> A;
    if (A[0] == '1' || A[sl - 1] == '1') {
      ans[3] = 2 * sl;
      cout << ans[3] << "\n";
    } else {
      for (int j = 0; j < sl; j++) {
        if (A[j] == '1') {
          ans[0] = 2 * (j + 1);
          ans[1] = 2 * (sl - j);
          flag = 1;
          break;
        }
      }
      for (int j = sl - 1; j >= 0; j--) {
        if (A[j] == '1') {
          ans[2] = 2 * (j + 1);
          ans[3] = 2 * (sl - j);
          flag = 1;
          break;
        }
      }
      if (flag == 0) {
        cout << sl << "\n";
      } else {
        sort(ans, ans + 4);
        cout << ans[3] << "\n";
      }
    }
  }
}
