#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int res = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') res = res * 10 + ch - 48, ch = getchar();
  return res * f;
}
const int maxn = 200005;
int a[maxn], cnt1[maxn], cnt2[maxn], cnt3, cnt4, max1, max2, suf[maxn];
signed main() {
  int t = read();
  while (t--) {
    int n = read();
    memset(cnt1, 0, sizeof cnt1);
    memset(cnt2, 0, sizeof cnt2);
    memset(suf, 0, sizeof suf);
    memset(a, 0, sizeof a);
    max1 = 0;
    cnt3 = 0;
    cnt4 = 0;
    for (register int i = 1; i <= n; i++) a[i] = read();
    for (register int i = n; i >= 1; i--) {
      if (cnt2[a[i]] == 0) cnt4++;
      cnt2[a[i]]++;
      suf[i] = max(suf[i + 1], a[i]);
    }
    vector<int> ans;
    int cnt = 0;
    for (register int i = 1; i < n; i++) {
      if (cnt1[a[i]] == 0) cnt3++;
      max1 = max(a[i], max1);
      cnt1[a[i]]++;
      if (cnt2[a[i]] == 1) cnt4--;
      cnt2[a[i]]--;
      if (cnt3 == max1 && i == cnt3 && cnt4 == suf[i + 1] &&
          n - i == suf[i + 1]) {
        cnt++;
        ans.push_back(i);
      }
    }
    cout << cnt << endl;
    for (auto i : ans) cout << i << ' ' << n - i << endl;
  }
  return 0;
}
