#include <bits/stdc++.h>
using namespace std;
long long n, a[200050];
bool ok1[200050], ok2[200050], vis1[200050], vis2[200050];
signed main() {
  long long t;
  cin >> t;
  while (t--) {
    cin >> n;
    for (long long i = 1; i <= n; i++) cin >> a[i];
    for (long long i = 1, mx = 0, cnt = 0; i <= n; i++) {
      if (!vis1[a[i]]) {
        vis1[a[i]] = 1;
        if (mx < a[i]) cnt += a[i] - mx, mx = a[i];
        cnt--;
        if (!cnt) ok1[i] = 1;
      } else
        break;
    }
    for (long long i = n, mx = 0, cnt = 0; i; i--) {
      if (!vis2[a[i]]) {
        vis2[a[i]] = 1;
        if (mx < a[i]) cnt += a[i] - mx, mx = a[i];
        cnt--;
        if (!cnt) ok2[i] = 1;
      } else
        break;
    }
    vector<long long> res;
    for (long long i = 1; i < n; i++)
      if (ok1[i] and ok2[i + 1]) res.push_back(i);
    for (long long i = 1; i <= n; i++)
      ok1[i] = ok2[i] = vis1[a[i]] = vis2[a[i]] = 0;
    cout << res.size() << '\n';
    for (auto x : res) cout << x << ' ' << n - x << '\n';
  }
}
