#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 10;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> vec(n);
    for (int i = 0; i < n; i += 1) cin >> vec[i];
    int mm = -1;
    vector<int> cantIz;
    vector<int> maxIz;
    set<int> cc;
    for (int i = 0; i < n; i += 1) {
      mm = max(mm, vec[i]);
      maxIz.push_back(mm);
      cc.insert(vec[i]);
      cantIz.push_back((int)(cc).size());
    }
    int mm2 = -1;
    vector<int> cantDer(n);
    vector<int> maxDer(n);
    set<int> cc2;
    for (int i = n - 1; i >= 0; i--) {
      mm2 = max(vec[i], mm2);
      maxDer[i] = mm2;
      cc2.insert(vec[i]);
      cantDer[i] = (int)(cc2).size();
    }
    int res = 0;
    int rr = 1;
    vector<pair<int, int> > re2;
    for (int i = 0; i < n - 1; i += 1) {
      if ((maxIz[i] == cantIz[i] && maxIz[i] == i + 1) &&
          (maxDer[i + 1] == cantDer[i + 1] && maxDer[i + 1] == n - rr)) {
        res++;
        re2.push_back(make_pair(i + 1, n - rr));
      }
      rr++;
    }
    cout << res << endl;
    for (int i = 0; i < (int)(re2).size(); i += 1) {
      cout << re2[i].first << " " << re2[i].second << endl;
    }
  }
  return 0;
}
