#include <bits/stdc++.h>
using namespace std;
bool has(vector<long long>& a, long long item) {
  long long l = -1;
  long long r = a.size();
  while (r - l > 1) {
    long long mid = (l + r) / 2;
    if (a[mid] > item)
      r = mid;
    else
      l = mid;
  }
  return a[l] == item;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cout.tie(0);
  std::cin.tie(0);
  set<long long> sums;
  for (long long i = 1; i < 200 * 1000 + 9; ++i) sums.insert((i + 1) * i / 2);
  long long t;
  cin >> t;
  for (long long o = 0; o < t; ++o) {
    long long n;
    cin >> n;
    vector<long long> a(n);
    for (long long i = 0; i < n; ++i) cin >> a[i];
    vector<long long> prefixSum(n);
    prefixSum[0] = a[0];
    for (long long i = 1; i < n; ++i) prefixSum[i] = prefixSum[i - 1] + a[i];
    vector<long long> suffixSum(n);
    suffixSum[n - 1] = a[n - 1];
    for (long long i = n - 2; i >= 0; --i)
      suffixSum[i] = suffixSum[i + 1] + a[i];
    std::set<int> pre;
    std::set<int> suf;
    std::multiset<int> sufMulti;
    for (int i = 0; i < n; ++i) suf.insert(a[i]), sufMulti.insert(a[i]);
    long long ans = 0;
    vector<std::pair<long long, long long>> answers;
    for (long long i = 0; i < n - 1; ++i) {
      pre.insert(a[i]);
      sufMulti.erase(sufMulti.find(a[i]));
      if (sufMulti.find(a[i]) == sufMulti.end()) suf.erase(a[i]);
      if ((sums.find(prefixSum[i]) != sums.end()) &&
          (sums.find(suffixSum[i + 1]) != sums.end()) &&
          (*(--pre.end()) == pre.size()) && (*(--suf.end()) == suf.size()) &&
          pre.size() == i + 1 && suf.size() == n - i - 1) {
        ++ans;
        answers.push_back(std::make_pair(i + 1, n - i - 1));
      }
    }
    cout << ans << "\n";
    for (long long i = 0; i < answers.size(); ++i)
      cout << answers[i].first << " " << answers[i].second << "\n";
  }
  return 0;
}
