#include <bits/stdc++.h>   using namespace std;   set<int> s;   int t, n, a[200020], cnt, d[200020], e[200020];   int main() {     for (scanf( %d , &t); t--; s.clear(), cnt = 0) {       scanf( %d , &n);       for (int i = 0; i < n; i++) d[i] = e[i] = 0;       for (int i = 0; i < n; i++) scanf( %d , a + i);       for (int i = 0; i < n; i++) {         if (s.count(a[i])) break;         s.insert(a[i]);         while (s.count(cnt + 1)) cnt++;         if (s.size() == cnt) d[i] = 1;       }       s.clear(), cnt = 0;       for (int i = n - 1; i >= 0; i--) {         if (s.count(a[i])) break;         s.insert(a[i]);         while (s.count(cnt + 1)) cnt++;         if (s.size() == cnt) e[i] = 1;       }       vector<int> v;       for (int i = 0; i < n - 1; i++) {         if (d[i] && e[i + 1]) v.push_back(i + 1);       }       printf( %d n , v.size());       for (int x : v) printf( %d %d n , x, n - x);     }   }   