#include <bits/stdc++.h>
using namespace std;
int findperm(vector<int> &v) {
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); ++i) {
    if (v[i] != i + 1) return 0;
  }
  return *(v.end() - 1);
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, aux;
    vector<int> v;
    cin >> n;
    while (n--) {
      cin >> aux;
      v.push_back(aux);
    }
    vector<pair<int, int>> ans;
    auto it = max_element(v.begin(), v.end());
    if (it != v.end()) {
      int dmax = ((int)v.size()) - (*it);
      if (dmax > 0) {
        pair<int, int> pal;
        auto itv = v.begin() + dmax;
        vector<int> auxv{v.begin(), itv};
        pal.first = findperm(auxv);
        if (pal.first != 0) {
          auxv = vector<int>(itv, v.end());
          pal.second = findperm(auxv);
          if (pal.second != 0) {
            ans.push_back(pal);
          }
        }
        auto itv2 = v.end() - dmax;
        if (dmax != v.size() / 2 || v.size() % 2 != 0) {
          auxv = vector<int>(v.begin(), itv2);
          pal.first = findperm(auxv);
          if (pal.first != 0) {
            auxv = vector<int>(itv2, v.end());
            pal.second = findperm(auxv);
            if (pal.second != 0) {
              ans.push_back(pal);
            }
          }
        }
      }
    }
    cout << ans.size() << "\n";
    for (auto val : ans) {
      cout << val.first << " " << val.second << endl;
    }
  }
  return 0;
}
