#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i = 0, j = 0, n, m, d, e = 0, t = 0, x, y, f = 0, o, k, z = 0,
                l = 0, x1, x2, y1, y2;
  cin >> t;
  while (t--) {
    cin >> n;
    vector<long long int> v;
    vector<long long int> v1;
    vector<long long int> a;
    vector<long long int> b;
    vector<long long int> c;
    vector<long long int> h;
    vector<long long int> p, p1, p2;
    set<long long int> s1, s2;
    s1.clear();
    s2.clear();
    p1.clear();
    p2.clear();
    p.clear();
    h.clear();
    f = 0;
    z = 0;
    l = 0;
    v1.clear();
    a.clear();
    b.clear();
    c.clear();
    v.clear();
    for (i = 0; i < n; i++) {
      cin >> x;
      v.push_back(x);
      if (x == 1) {
        v1.push_back(i);
        f++;
      }
    }
    if (f != 2) {
      cout << "0" << endl;
      continue;
    } else {
      for (i = 0; i < n; i++) {
        s1.insert(v[i]);
        s2.insert(v[n - 1 - i]);
        p1.push_back(s1.size());
        p2.push_back(s2.size());
      }
      long long int sum = 0;
      k = 1;
      d = 0;
      for (i = 0; i < n; i++) {
        d = d + k;
        c.push_back(d);
        k++;
      }
      d = 0;
      k = 1;
      for (i = 0; i < n; i++) {
        sum = sum + v[i];
        a.push_back(sum);
      }
      sum = 0;
      for (i = 0; i < n; i++) {
        sum = sum + v[n - 1 - i];
        b.push_back(sum);
      }
      for (j = v1[0]; j < v1[1]; j++) {
        if (b[n - 1 - j - 1] == c[n - 1 - j - 1] && a[j] == c[j] &&
            p1[j] == j + 1 && p2[n - 1 - j - 1] == n - (j + 1)) {
          l++;
          h.push_back(j + 1);
          p.push_back(n - (j + 1));
          z = 1;
        }
      }
      if (z == 0) {
        cout << "0" << endl;
      }
      if (z == 1) {
        cout << l << endl;
        for (i = 0; i < l; i++) {
          cout << h[i] << " " << p[i] << endl;
        }
      }
    }
  }
}
