#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
long long mod = 1000000007;
const int MX = 0x3f3f3f3f;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n, i;
    cin >> n;
    int a[n];
    for (i = 0; i <= n - 1; i++) cin >> a[i];
    set<int> f, l;
    long long sum = 0;
    long long j = 0;
    vector<int> l1(n), l2(n);
    for (i = 0; i <= n - 2; i++) {
      sum += a[i];
      if (f.find(a[i]) != f.end()) break;
      f.insert(a[i]);
      j = f.size();
      if (j * (j + 1) / 2 == sum) l1[i] = 1;
    }
    sum = 0;
    for (i = n - 1; i >= 1; i--) {
      sum += a[i];
      if (l.find(a[i]) != l.end()) break;
      l.insert(a[i]);
      j = l.size();
      if (j * (j + 1) / 2 == sum) l2[i] = 1;
    }
    int ans = 0;
    vector<pair<int, int> > vp;
    for (i = 0; i <= n - 2; i++) {
      if (l1[i] && l2[i + 1])
        ans++, vp.emplace_back(make_pair(i + 1, n - i - 1));
    }
    cout << ans << "\n";
    for (i = 0; i <= int(vp.size()) - 1; i++)
      cout << vp[i].first << " " << vp[i].second << "\n";
  }
  return 0;
}
