#include <bits/stdc++.h>
using namespace std;
bool check(int a[], int start, int end) {
  int len = end - start;
  vector<bool> used(len + 1, false);
  for (int i = start; i < end; i++) {
    if (a[i] > len || used[a[i]]) return false;
    used[a[i]] = true;
  }
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n];
    int l2 = 0;
    for (int i = 0; i < (n); ++i) {
      cin >> a[i];
      l2 = max(l2, a[i]);
    }
    int l1 = n - l2;
    vector<pair<int, int>> ans;
    if (check(a, 0, l1) && check(a, l1, n)) {
      ans.push_back({l1, n - l1});
    }
    if (l1 != l2 && check(a, 0, l2) && check(a, l2, n)) {
      ans.push_back({l2, n - l2});
    }
    cout << ans.size() << endl;
    for (auto p : ans) {
      cout << p.first << " " << p.second << endl;
    }
  }
}
