#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int arr[n];
    for (long long i = 0; i < n; i++) cin >> arr[i];
    ;
    unordered_map<int, vector<int>> m1;
    for (int i = 0; i < n; i++) {
      m1[arr[i]].push_back(i + 1);
    }
    if (m1.size() == 1) {
      cout << "NO" << '\n';
      continue;
    }
    cout << "YES" << '\n';
    pair<int, vector<int>> fe = *m1.begin();
    m1.erase(fe.first);
    int parent = fe.second[0];
    for (auto x : m1) {
      for (auto y : x.second) {
        cout << parent << " " << y << '\n';
      }
      parent = x.second[0];
    }
    for (int i = 1; i < fe.second.size(); i++) {
      cout << parent << " " << fe.second[i] << '\n';
    }
  }
}
