#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  map<int, int> mp;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    mp[arr[i]]++;
  }
  int mini = INT_MAX;
  int val;
  for (auto it : mp) {
    if (it.second < mini) {
      mini = it.second;
      val = it.first;
    }
  }
  if (mini == n) {
    cout << "NO\n";
    return;
  }
  int idx;
  for (int i = 0; i < n; i++) {
    if (arr[i] == val) {
      idx = i;
      break;
    }
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    if (arr[i] != val) cout << idx + 1 << " " << i + 1 << "\n";
  }
  --mini;
  vector<int> index;
  for (int i = n - 1; i >= 0; i--) {
    if (arr[i] == val) {
      index.push_back(i + 1);
    }
  }
  for (int i = n - 1, j = 0; i >= 0; i--) {
    if (arr[i] != val) {
      while (mini > 0) {
        cout << i + 1 << " " << index[j++] << "\n";
        mini--;
      }
    }
  }
  return;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
