#include <bits/stdc++.h>
using namespace std;
vector<int> used, a;
map<int, vector<int> > g;
vector<pair<int, int> > ans;
bool was = false;
int n;
int main() {
  int test;
  cin >> test;
  for (; test--;) {
    cin >> n;
    g.clear();
    ans.clear();
    a.clear();
    int t = 0, t1 = 0;
    for (int i = 0, x; i < n; i++) {
      cin >> x;
      g[x].push_back(i);
      a.push_back(x);
      if (i > 0) {
        if (x != a[t]) t1 = i;
      }
    }
    for (int i = 1; i < n; i++) {
      if (a[t] != a[i]) {
        ans.push_back({t, i});
      } else {
        ans.push_back({i, t1});
      }
    }
    if (t1 == 0) {
      cout << "NO\n";
    } else {
      cout << "YES\n";
      for (int i = 0; i < n - 1; i++) {
        cout << ans[i].first + 1 << " " << ans[i].second + 1 << '\n';
      }
    }
  }
}
