#include <bits/stdc++.h>
using namespace std;
void IO() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
long long binary_exponention(long long a, long long b) {
  if (b == 0) return 1;
  long long res = binary_exponention(a, b / 2);
  if (b % 2) return res * res * a;
  return res * res;
}
void read(long long a[], int n, int which = 0) {
  if (which == 0)
    for (int i = 0; i < n; i++) cin >> a[i];
  else
    for (int i = 1; i <= n; i++) cin >> a[i];
}
void solve() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  vector<int> ans;
  map<int, int> m;
  set<int> second;
  priority_queue<int> mx;
  priority_queue<int, vector<int>, greater<int>> mn;
  for (int i = 0; i < n - 1; i++) {
    if (second.find(a[i]) != second.end()) break;
    mn.push(a[i]);
    mx.push(a[i]);
    second.insert(a[i]);
    if (mn.top() == 1 && mx.top() == i + 1) m[i] = 1;
  }
  second.clear();
  mn = priority_queue<int, vector<int>, greater<int>>();
  mx = priority_queue<int>();
  for (int i = n - 1; i; i--) {
    if (second.find(a[i]) != second.end()) break;
    mn.push(a[i]);
    second.insert(a[i]);
    mx.push(a[i]);
    if (mn.top() == 1 && mx.top() == n - i) {
      if (m[i - 1]) ans.push_back(n - i);
    }
  }
  cout << int(ans.size()) << "\n";
  for (int i : ans) {
    cout << n - i << " " << i << "\n";
  }
}
int main() {
  IO();
  int t;
  cin >> t;
  while (t--) solve();
}
