#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    long long p[n];
    p[0] = a[0];
    for (int i = 1; i < n; i++) p[i] = p[i - 1] + (long long)a[i];
    unordered_set<int> s;
    int pc[n];
    for (int i = 0; i < n; i++) {
      s.insert(a[i]);
      pc[i] = s.size();
    }
    s.clear();
    int sc[n];
    for (int i = n - 1; i >= 0; i--) {
      s.insert(a[i]);
      sc[i] = s.size();
    }
    vector<pair<int, int>> v;
    for (long long i = 0; i < n - 1; i++) {
      long long l = (i + 1) * (i + 2) / 2;
      long long r = (n - 1 - i) * (n - i) / 2;
      if (pc[i] == (i + 1) && sc[i + 1] == (n - 1 - i) && p[i] == l &&
          p[n - 1] - p[i] == r) {
        v.push_back(make_pair(i + 1, n - 1 - i));
      }
    }
    cout << v.size() << "\n";
    for (int i = 0; i < v.size(); i++) {
      cout << v[i].first << " " << v[i].second << "\n";
    }
  }
  return 0;
}
