#include <bits/stdc++.h>
using namespace std;
int main() {
  int tc, o;
  scanf("%d", &tc);
  for (o = 1; o <= tc; o++) {
    long long n, m, a, b, c, d, e, f, g, p, q, r, fr, sc, tr, sz, tz, sz1, sz2,
        i, j, k, mx = -9, mn = 999999999999;
    string str, ttr, ntr;
    long long x = 0, y = 0, cnt = 0, res = -3, ttl = -3, ans = 0, sum = 0;
    long long flg = 0, flag = 1, na = 0, as = 1;
    vector<long long> u, v, w;
    vector<pair<long long, long long> > vct, tct;
    vector<string> vst;
    set<long long> st, nt, tt;
    map<long long, long long> mp, nq, qr, mp1, mp2;
    scanf("%lld", &n);
    for (i = 1; i <= n; i++) {
      scanf("%lld", &a);
      v.push_back(a);
    }
    for (i = 0; i < n; i++) {
      fr = v[i];
      mp[fr]++;
      if (mp[fr] == 1) {
        if (fr > mx) {
          mx = fr;
        }
      } else {
        y++;
        if (y == 2) {
          flg = 9;
          break;
        }
        mp.clear();
        if (mx == i) {
          p = i + 1 - 1;
        } else {
          flg = 9;
          break;
        }
        mp[fr]++;
        mx = fr;
      }
    }
    if (flg == 0) {
      q = n - p;
      if (q == mx && p != 0 && p != n) {
        vct.push_back(make_pair(p, q));
        res = p;
        ttl = q;
      }
    }
    flg = 0;
    mx = -9;
    mp.clear();
    y = 0;
    for (i = n - 1; i >= 0; i--) {
      fr = v[i];
      mp[fr]++;
      if (mp[fr] == 1) {
        if (fr > mx) {
          mx = fr;
        }
      } else {
        y++;
        if (y == 2) {
          flg = 9;
          break;
        }
        mp.clear();
        if (mx == n - i - 1) {
          p = n - i - 1;
        } else {
          flg = 9;
          break;
        }
        mp[fr]++;
        mx = fr;
      }
    }
    if (flg == 0) {
      q = n - p;
      if (q == mx && q != n && q != 0 && q != res) {
        vct.push_back(make_pair(q, p));
      }
    }
    sz = vct.size();
    printf("%lld\n", sz);
    for (i = 0; i < sz; i++) {
      f = vct[i].first;
      g = vct[i].second;
      if (i == 0) {
        printf("%lld %lld\n", f, g);
      } else {
        printf("%lld %lld\n", f, g);
      }
    }
    v.clear();
    vct.clear();
  }
  return 0;
}
