#include <bits/stdc++.h>
using namespace std;
long long pow_mod(long long nn, long long pp, long long mm) {
  long long res = 1;
  while (pp > 0) {
    if (pp & 1) res = (res * nn) % mm;
    pp = pp >> 1;
    nn = (nn * nn) % mm;
  }
  return res;
}
void olium();
int main() {
  0;
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t = 1;
  cin >> t;
  for (int i = 1; i <= t; i++) {
    olium();
  }
  return 0;
}
void olium() {
  int n;
  cin >> n;
  long long a[n + 1];
  map<long long, vector<int> > gang;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    gang[a[i]].push_back(i);
  }
  vector<pair<int, int> > edg;
  int fst = gang.begin()->second[0];
  int nxt = -1;
  for (auto it = next(gang.begin(), 1); it != gang.end(); it++) {
    for (auto i : it->second) {
      edg.push_back({fst, i});
      if (nxt == -1) nxt = i;
    }
  }
  if (nxt != -1)
    for (int i = 1; i <= gang.begin()->second.size() - 1; i++) {
      edg.push_back({nxt, gang.begin()->second[i]});
    }
  if (edg.size() != n - 1) {
    cout << "NO\n";
    return;
  }
  cout << "YES\n";
  for (auto i : edg) {
    cout << i.first << ' ' << i.second << '\n';
  }
}
