#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<int> a(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  vector<pair<int, int>> edg;
  vector<bool> vis(n + 1);
  function<void(int, int)> dfs = [&](int v, int p) {
    edg.emplace_back(v, p);
    vis[v] = true;
    for (int i = 1; i <= n; i++) {
      if (i != v && !vis[i] && a[i] != a[v]) dfs(i, v);
    }
  };
  dfs(1, 0);
  if (edg.size() == n) {
    cout << "YES\n";
    for (int i = 1; i < n; i++) {
      cout << edg[i].first << " " << edg[i].second << '\n';
    }
  } else {
    cout << "NO\n";
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
