#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n];
    multiset<int> s;
    for (int i = 0; i < n; i++) cin >> a[i];
    vector<int> v;
    map<int, int> m;
    int x = 1;
    int ans[n];
    memset(ans, 0, sizeof(ans));
    for (int i = 0; i < n; i++) {
      s.insert(a[i]);
      m[a[i]]++;
      if (m[a[i]] > 1) break;
      while (s.find(x) != s.end()) {
        s.erase(s.find(x));
        x++;
      }
      if (s.size() == 0) ans[i] = 1;
    }
    s.clear();
    m.clear();
    int c = 0;
    x = 1;
    for (int i = n - 1; i > 0; i--) {
      s.insert(a[i]);
      m[a[i]]++;
      if (m[a[i]] > 1) break;
      while (s.find(x) != s.end()) {
        s.erase(s.find(x));
        x++;
      }
      if (s.size() == 0 && ans[i - 1] == 1)
        ans[i] = 1, v.push_back(i - 1);
      else
        ans[i] = 0;
    }
    cout << v.size() << endl;
    for (int i = 0; i < v.size(); i++) {
      cout << v[i] + 1 << " " << n - v[i] - 1 << endl;
    }
  }
}
