#include <bits/stdc++.h>
using namespace std;
const long long mod = (long long)998244353;
void test_case() {
  long long n;
  cin >> n;
  vector<long long> arr(n), pos(n);
  for (long long i = 0; i < n; i++) cin >> arr[i];
  set<long long> st;
  long long sum = 0;
  for (long long i = 0; i < n - 1; i++) {
    sum += arr[i];
    st.insert(arr[i]);
    if (sum == ((i + 1) * (i + 2) / 2) && (long long)st.size() == i + 1)
      pos[i] = 1;
  }
  st.clear(), sum = 0;
  vector<pair<long long, long long> > len;
  for (long long i = n - 1; i > 0; i--) {
    sum += arr[i];
    st.insert(arr[i]);
    long long j = n - i;
    if (sum == ((j + 1) * (j) / 2) && (long long)st.size() == j) {
      if (pos[i - 1]) {
        len.push_back({n - j, j});
      }
    }
  }
  cout << len.size() << "\n";
  for (long long i = 0; i < (long long)len.size(); i++)
    cout << len[i].first << " " << len[i].second << "\n";
}
signed main() {
  long long t = 1;
  cin >> t;
  while (t--) test_case();
}
