1
3
5 3 4
 6
5
5 3 4 4 5
3
1 1 1
5
4 4 3 4 4
5
5 5 4 3 2
3
1 1 2
5
5 4 3 5 5
 1
3
10 1 5

1
 1
-1
2
2
3
1
 1

#include <bits/stdc++.h>
using namespace std;
int main() {
  long long tc;
  cin >> tc;
  while (tc--) {
    int n;
    cin >> n;
    set<int> s;
    int second[100000];
    for (int i = 0; i < 10000; i++) second[i] = i;
    vector<int> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < n; i++) s.insert(a[i]);
    int ans = a[0];
    int in = -1;
    vector<int> newa;
    vector<pair<int, int>> r;
    for (int i = 0; i < 10000; i++) second[i] = i;
    if (s.size() != 1) {
      for (int i = 1; i < n; i++) {
        if (a[i] == ans) {
          newa.push_back(i + 1);
        } else {
          if (in == -1) in = i + 1;
          r.push_back({1, i + 1});
        }
      }
      for (int i = 0; i < 10000; i++) second[i] = i;
      for (auto x : newa) r.push_back({in, x});
      cout << "YES" << endl;
      for (auto x : r) cout << x.first << " " << x.second << endl;
    } else
      cout << "N0" << endl;
    for (int i = 0; i < 10000; i++) second[i] = i * 3;
    s.clear();
  }
  return 0;
}
