#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, a[200000], cf[200000], l = 0, ans[2] = {0};
    map<int, int> cnt;
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      cf[i] = a[i];
      cnt[a[i]]++;
    }
    for (int i = 1; i <= n; i++) {
      if (cnt[i] < 2)
        break;
      else if (cnt[i] == 2)
        l = i;
    }
    {
      int flag = 0;
      sort(a, a + l);
      sort(a + l, a + n);
      for (int i = 0; i < l; i++) {
        if (a[i] != i + 1) {
          flag = 1;
          break;
        }
      }
      for (int i = l; i < n; i++) {
        if (a[i] != i + 1 - l) {
          flag = 1;
          break;
        }
      }
      if (flag == 0) ans[0] = 1;
    }
    if (l != n - l) {
      int flag = 0;
      sort(cf, cf + n - l);
      sort(cf + n - l, cf + n);
      for (int i = 0; i < n - l; i++) {
        if (cf[i] != i + 1) {
          flag = 1;
          break;
        }
      }
      for (int i = n - l; i < n; i++) {
        if (cf[i] != i + 1 - (n - l)) {
          flag = 1;
          break;
        }
      }
      if (flag == 0) ans[1] = 1;
    }
    cout << ans[0] + ans[1] << "\n";
    if (ans[0] == 1) cout << l << " " << n - l << "\n";
    if (ans[1] == 1) cout << n - l << " " << l << "\n";
  }
  return 0;
}
