#include <bits/stdc++.h>
const long long MOD = 1000000007;
const long long inf = 1000000000000000000;
using namespace std;
long long int modpow(long long int x, long long int n) {
  long long int res = 1;
  while (n > 0) {
    if (n & 1) res = res * x % MOD;
    x = x * x % MOD;
    n >>= 1;
  }
  return res;
}
long long int power(long long int x, long long int n) {
  long long int res = 1;
  while (n > 0) {
    if (n & 1) res = res * x;
    x = x * x;
    n >>= 1;
  }
  return res;
}
void solve() {
  int n;
  cin >> n;
  std::vector<int> a(n + 1);
  map<int, int> m;
  int x = 0;
  std::vector<int> v[n + 10], cnt(n + 10, 0);
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (!m[a[i]]) {
      m[a[i]] = ++x;
    }
    a[i] = m[a[i]];
    v[a[i]].push_back(i);
    cnt[a[i]]++;
  }
  if (x == 1) {
    cout << "NO\n";
    return;
  }
  std::vector<int> lev[n + 10];
  int node;
  lev[1].push_back(v[x].back());
  node = v[x].back();
  v[x].pop_back();
  cout << "YES\n";
  for (int i = 1; i <= x; i++) {
    int y = v[i].back();
    while (v[i].size()) {
      cout << node << " " << v[i].back() << endl;
      v[i].pop_back();
    }
    node = y;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  int t = 1, tt = 1;
  cin >> t;
  while (tt <= t) {
    solve();
    tt++;
  }
  cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
       << "ms\n";
}
