func_code_string: #include <bits/stdc++.h>   using namespace std;   int a[100000];   void solve() {     int i, j, n;     cin >> n;     for (int i = 1; i <= n; i++) cin >> a[i];     bool ok = 0;     for (int i = 2; i <= n; i++)       if (a[i] != a[i - 1]) ok = 1;     if (!ok) {       cout <<  NO             <<   n ;       return;     }     map<int, int> M;     int minc = 100000;     for (int i = 1; i <= n; i++) {       M[a[i]]++;     }     for (int i = 1; i <= n; i++) {       if (M[a[i]] < minc) {         minc = M[a[i]];       }     }     int root = -1;     int val = -1;     for (int i = 1; i <= n; i++) {       if (M[a[i]] == minc) {         root = i;         val = a[i];         break;       }     }     vector<pair<int, int>> edge;     int last;     vector<int> free;     for (int i = 1; i <= n; i++) {       if (a[i] != val) {         edge.push_back({root, i});         free.push_back(i);       }     }     vector<int> same;     for (int i = 1; i <= n; i++) {       if (i != root && a[i] == val) {         same.push_back(i);       }     }     for (int i = 0; i < same.size(); i++) {       edge.push_back({free[i], same[i]});     }     cout <<  YES           <<   n ;     for (int i = 0; i < edge.size(); i++)       cout << edge[i].first <<     << edge[i].second <<   n ;     return;   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int t;     cin >> t;     while (t--) {       solve();     }     return 0;   }   