#include <bits/stdc++.h>
using namespace std;
const long long sz = 5009;
long long ara[sz];
unordered_map<int, int> cnt;
unordered_map<int, vector<int> > city;
const bool cmp(const int &a, const int &b) { return cnt[a] < cnt[b]; }
int main() {
  long long t;
  cin >> t;
  while (t--) {
    cnt.clear(), city.clear();
    long long n;
    scanf("%lld", &n);
    vector<int> lst;
    vector<pair<int, int> > ans;
    for (long long i = 1; i <= n; ++i) {
      scanf("%lld", &ara[i]);
      city[ara[i]].push_back(i);
      if (cnt.find(ara[i]) == cnt.end()) lst.push_back(ara[i]);
      ++cnt[ara[i]];
    }
    sort(lst.begin(), lst.end(), cmp);
    if (lst.size() == 1) {
      printf("NO\n");
      continue;
    }
    for (long long i = lst.size() - 1; i >= 1; i--) {
      vector<int> &v = city[lst[i]];
      int prv = city[lst[i - 1]][0];
      for (int &c : v) ans.push_back(make_pair(c, prv));
    }
    vector<int> &v = city[lst[0]];
    for (long long i = 1; i < v.size(); i++) {
      int nxt = city[lst[1]][0];
      ans.push_back(make_pair(v[i], nxt));
    }
    printf("YES\n");
    for (pair<int, int> &p : ans) printf("%d %d\n", p.first, p.second);
  }
  return 0;
}
