#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
int t;
int n, m;
int a[maxn];
int main() {
  scanf("%d", &t);
  int o = 1;
  while (t--) {
    bool vis1[maxn] = {0}, vis2[maxn] = {0};
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i) scanf("%d", a + i);
    int mx1 = 0, len1 = 0;
    int mx2 = 0, len2 = 0;
    map<int, int> mp1, mp2;
    mp1.clear();
    mp2.clear();
    for (int i = 1; i <= n; ++i) {
      if (vis1[a[i]])
        break;
      else {
        vis1[a[i]] = 1;
        ++len1;
        mx1 = max(mx1, a[i]);
        if (mx1 == len1) mp1[len1]++;
      }
    }
    for (int i = n; i >= 1; --i) {
      if (vis2[a[i]])
        break;
      else {
        vis2[a[i]] = 1;
        ++len2;
        mx2 = max(mx2, a[i]);
        if (mx2 == len2) mp2[len2]++;
      }
    }
    int ans = 0;
    vector<int> v;
    v.clear();
    for (auto i : mp1) {
      int j = i.first;
      if (mp2.count(n - j)) {
        v.push_back(j);
      }
    }
    printf("%d\n", v.size());
    for (int i : v) {
      printf("%d %d\n", i, n - i);
    }
  }
}
