#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, x;
  cin >> t;
  while (t--) {
    cin >> n;
    map<int, vector<int>> m;
    vector<int> v[n];
    for (int i = 0; i < n; i++) {
      cin >> x;
      m[x].push_back(i);
    }
    if (m.size() == 1)
      cout << "NO\n";
    else {
      cout << "YES\n";
      int k = m.begin()->second[0];
      auto it = m.begin();
      for (it++; it != m.end(); it++) {
        for (int u : it->second) {
          cout << k + 1 << ' ' << u + 1 << '\n';
        }
      }
      if ((*(m.begin())).second.size() > 1) {
        k = m.rbegin()->second[0];
        for (auto it = (*(m.begin())).second.begin() + 1;
             it != (*(m.begin())).second.end(); it++) {
          cout << *it + 1 << ' ' << k + 1 << '\n';
        }
      }
    }
  }
  return 0;
}
