#include <bits/stdc++.h>
using namespace std;
const long long int NUM = 2e5 + 5;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int num_tests = 1;
  cin >> num_tests;
  while (num_tests-- > 0) {
    long long int n;
    cin >> n;
    vector<long long int> a(n);
    for (long long int i = 0; i < n; i++) cin >> a[i];
    long long int mx = *max_element(a.begin(), a.end());
    long long int mn = n - mx;
    long long int ans = 0;
    map<long long int, long long int> one, two;
    for (long long int i = 0; i < mn; i++) one[a[i]] = 1;
    for (long long int i = mn; i < n; i++) two[a[i]] = 1;
    bool ok = 1;
    for (long long int i = 1; i < mn + 1; i++)
      if (!one[i]) {
        ok = 0;
        break;
      }
    for (long long int i = 1; i < mx + 1; i++)
      if (!two[i]) {
        ok = 0;
        break;
      }
    bool ok2 = 1;
    one.clear();
    two.clear();
    for (long long int i = 0; i < mx; i++) one[a[i]] = 1;
    for (long long int i = mx; i < n; i++) two[a[i]] = 1;
    for (long long int i = 1; i < mx + 1; i++)
      if (!one[i]) {
        ok2 = 0;
        break;
      }
    for (long long int i = 1; i < mn + 1; i++)
      if (!two[i]) {
        ok2 = 0;
        break;
      }
    if (!ok && !ok2)
      cout << 0 << "\n";
    else if (ok && ok2) {
      if (mx != n - mx)
        cout << 2 << "\n"
             << mx << " " << n - mx << "\n"
             << n - mx << " " << mx << "\n";
      else
        cout << 1 << "\n" << mx << " " << n - mx << "\n";
    } else if (!ok2)
      cout << 1 << "\n" << mn << " " << mx << "\n";
    else if (ok2)
      cout << 1 << "\n" << mx << " " << mn << "\n";
  }
}
