#include <bits/stdc++.h>
using namespace std;
const long long inf = 2e9;
const long long INF = 8e18;
const long long maxn = 2e5 + 5;
long long a[maxn], num[maxn], num2[maxn], sum[maxn];
inline void init(long long n) {
  for (long long i = 0; i < n + 5; ++i) num[i] = num2[i] = sum[i] = 0;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    init(n);
    bool ok = 1;
    long long cnt = 0, cnt2 = 0;
    for (long long i = 1; i <= n; ++i) {
      cin >> a[i];
      ++num[a[i]];
      if (num[a[i]] == 1)
        ++cnt;
      else
        --cnt, ++cnt2;
      sum[i] = sum[i - 1] + a[i];
      if (num[a[i]] > 2) ok = 0;
    }
    if (!ok) {
      cout << 0 << '\n';
      continue;
    }
    long long now = 0;
    vector<long long> res;
    for (long long i = 1; i <= n; ++i) {
      ++num2[a[i]];
      if (num2[a[i]] == 1)
        ++now;
      else
        break;
      if (num[a[i]] == 2)
        --cnt2, ++cnt;
      else
        --cnt;
      --num[a[i]];
      if (cnt2 == 0) {
        long long p1 = (1 + i) * i / 2;
        long long p2 = (1 + n - i) * (n - i) / 2;
        if (sum[i] == p1 && sum[n] - sum[i] == p2) res.push_back(i);
      }
    }
    cout << res.size() << '\n';
    for (auto x : res) cout << x << ' ' << n - x << '\n';
  }
  return 0;
}
