#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while ((t--) > 0) {
    long long int n;
    cin >> n;
    long long int a[n];
    long long int totsum = 0;
    for (long long int i = 0; i < n; i++) cin >> a[i], totsum += a[i];
    long long int sum[n];
    sum[0] = a[0];
    for (long long int i = 1; i < n; i++) sum[i] = sum[i - 1] + a[i];
    long long int answer = 0;
    vector<pair<long long int, long long int>> vect;
    set<long long int> s1;
    long long int isunique[n];
    unordered_map<long long int, long long int> umap;
    umap[a[n - 1]] = 1;
    isunique[n - 1] = 1;
    for (long long int i = n - 2; i >= 0; i--) {
      if (umap.find(a[i]) == umap.end() && isunique[i + 1] == 1) {
        isunique[i] = 1;
        umap[a[i]] = 1;
      } else {
        isunique[i] = 0;
        umap[a[i]] = 1;
      }
    }
    for (long long int i = 0; i < n; i++) {
      s1.insert(a[i]);
      if (sum[i] == ((i + 1) * (i + 2) / 2) && s1.size() == i + 1 &&
          (totsum - sum[i]) == ((n - i - 1) * (n - i) / 2) &&
          isunique[i + 1] == 1 && i != n - 1) {
        answer += 1;
        vect.push_back(make_pair(i + 1, n - i - 1));
      }
      if (sum[i] == ((i + 1) * (i + 2) / 2) && s1.size() == i + 1 &&
          i == n - 1) {
        answer += 1;
        vect.push_back(make_pair(i + 1, n - i - 1));
      }
    }
    cout << answer << endl;
    for (long long int i = 0; i < vect.size(); i++) {
      cout << vect[i].first << " " << vect[i].second << endl;
    }
  }
}
