#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
const long long inf = 1e18;
const long long mxn = 1e7;
bool prime[mxn + 1];
long long power(long long x, unsigned long long y) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res = res * x;
    y = y >> 1;
    x = x * x;
  }
  return res;
}
bool isPrime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
signed main() {
  long long t = 1;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long a[n + 1];
    for (long long i = 1; i <= n; i++) cin >> a[i];
    ;
    long long mx = a[1];
    for (long long i = 2; i <= n; i++)
      if (mx < a[i]) mx = a[i];
    long long mn = n - mx;
    long long b[n + 1], c[n + 1];
    for (long long i = 1; i <= n; i++) {
      b[i] = a[i];
      c[i] = a[i];
    }
    sort(b + 1, b + mx + 1);
    sort(b + mx + 1, b + n + 1);
    sort(c + 1, c + mn + 1);
    sort(c + mn + 1, c + n + 1);
    bool b1 = 0, b2 = 0, c1 = 0, c2 = 0;
    for (long long i = 1; i <= mx; i++) {
      if (b[i] != i) {
        b1 = 1;
        break;
      }
    }
    for (long long i = mx + 1; i <= n; i++) {
      if (b[i] != (i - mx)) {
        b2 = 1;
        break;
      }
    }
    for (long long i = 1; i <= mn; i++) {
      if (c[i] != i) {
        c1 = 1;
        break;
      }
    }
    for (long long i = mn + 1; i <= n; i++) {
      if (c[i] != (i - mn)) {
        c2 = 1;
        break;
      }
    }
    long long cnt = 0;
    bool cnt1;
    if (b1 == 0 && b2 == 0) {
      cnt++;
      cnt1 = 0;
    }
    if (c1 == 0 && c2 == 0) {
      cnt++;
      cnt1 = 1;
    }
    if (cnt == 0) {
      cout << 0 << endl;
    } else if (cnt == 1) {
      if (cnt1) {
        cout << 1 << endl;
        cout << mn << " " << mx << endl;
      } else {
        cout << 1 << endl;
        cout << mx << " " << mn << endl;
      }
    } else if (cnt == 2 && mx == mn) {
      cout << 1 << endl;
      cout << mx << " " << mn << endl;
    } else {
      cout << 2 << endl;
      cout << mn << " " << mx << endl;
      cout << mx << " " << mn << endl;
    }
  }
}
