#include <bits/stdc++.h>
using namespace std;
vector<string> vec_splitter(string second) {
  second += ',';
  vector<string> res;
  while (!second.empty()) {
    res.push_back(second.substr(0, second.find(',')));
    second = second.substr(second.find(',') + 1);
  }
  return res;
}
void debug_out(vector<string> __attribute__((unused)) args,
               __attribute__((unused)) int idx,
               __attribute__((unused)) int LINE_NUM) {
  cerr << endl;
}
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
  if (idx > 0)
    cerr << ", ";
  else
    cerr << "Line(" << LINE_NUM << ") ";
  stringstream ss;
  ss << H;
  cerr << args[idx] << " = " << ss.str();
  debug_out(args, idx + 1, LINE_NUM, T...);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int tt = clock();
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n];
    unordered_map<int, queue<pair<int, int> > > m;
    vector<pair<int, int> > temp;
    map<int, int> make_pair;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      make_pair[a[i]]++;
    }
    bool no = false;
    for (auto k : make_pair) {
      if (k.second == n) {
        no = true;
        break;
      }
    }
    if (no)
      cout << "NO" << endl;
    else {
      cout << "YES" << endl;
      int val = a[0];
      vector<int> rem;
      for (int i = 1; i < n; i++) {
        if (a[i] != val) {
          cout << 1 << " " << i + 1 << endl;
        } else {
          rem.push_back(i + 1);
        }
      }
      for (int i = 1; i < n; i++) {
        if (a[i] != val) {
          for (auto second : rem) {
            cout << i + 1 << " " << second << endl;
          }
          break;
        }
      }
    }
  }
  cerr << "TIME = " << (double)1.0 * (clock() - tt) / CLOCKS_PER_SEC
       << " seconds" << endl;
  return 0;
}
