#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  char c = getchar();
  int x = 0;
  bool op = 0;
  while (!isdigit(c)) op |= (c == '-'), c = getchar();
  while (isdigit(c)) x = (x << 1) + (x << 3) + (c ^ 48), c = getchar();
  return op ? -x : x;
}
const int N = 200010;
int t, n;
int a[N], f[N], tot[N];
bool ans[N], vis[N];
void init() {
  for (int i = 1; i <= n; i++) {
    tot[i] = 1;
    f[i] = i;
  }
  return;
}
int find(int x) {
  if (f[x] == x) {
    return x;
  }
  return f[x] = find(f[x]);
}
void unionn(int x, int y) {
  int fx = find(x), fy = find(y);
  if (fx != fy) {
    f[fy] = fx;
    tot[fx] += tot[fy];
  }
  return;
}
int main() {
  t = read();
  while (t--) {
    memset(ans, false, sizeof(ans));
    n = read();
    for (int i = 1; i <= n; i++) {
      a[i] = read();
    }
    bool flag = false;
    init();
    for (int i = 1; i <= n; i++) {
      if (a[i] == 1)
        flag = true;
      else
        unionn(a[i], a[i] - 1);
      if (flag == true && tot[find(1)] == i) ans[i] = true;
    }
    init();
    flag = false;
    int cnt = 0;
    for (int i = n; i >= 1; i--) {
      if (a[i] == 1)
        flag = true;
      else
        unionn(a[i], a[i] - 1);
      if (flag == false || tot[find(1)] != n - i + 1) ans[i - 1] = false;
    }
    for (int i = 1; i <= n; i++) {
      if (ans[i] == true) cnt++;
    }
    printf("%d\n", cnt);
    for (int i = 1; i <= n; i++) {
      if (ans[i] == true) {
        printf("%d %d\n", i, n - i);
      }
    }
  }
  return 0;
}
