#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e6 + 9;
int a[MAX], n, b[MAX], c[MAX];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    cin >> n;
    vector<pair<int, int> > ans;
    fill(b, b + n + 5, 0);
    fill(c, c + n + 5, 0);
    int mx = 0;
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < n; i++) {
      if (c[a[i]]) break;
      c[a[i]] = 1;
      mx = max(mx, a[i]);
      if (mx == i + 1) b[i] = 1;
    }
    mx = 0;
    fill(c, c + n + 5, 0);
    for (int i = n - 1; i >= 0; i--) {
      if (c[a[i]]) break;
      c[a[i]] = 1;
      mx = max(mx, a[i]);
      if (mx == n - i && b[i - 1]) ans.push_back({i, n - i});
    }
    cout << ans.size() << '\n';
    for (auto x : ans) cout << x.first << " " << x.second << '\n';
  }
  return 0;
}
