#include <bits/stdc++.h>
using namespace std;
int _ = 1, tc = 1;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const int MAXN = 1e7 + 1;
int spf[MAXN];
int d, x, y;
void sieve() {
  for (int i = 1; i < MAXN; i++) spf[i] = i;
  for (int i = 4; i < MAXN; i += 2) spf[i] = 2;
  for (int i = 3; i * i < MAXN; i += 2) {
    if (spf[i] == i) {
      for (int j = i * i; j < MAXN; j += i) {
        if (spf[j] == j) spf[j] = i;
      }
    }
  }
}
void extended_gcd(int a, int b) {
  if (b == 0) {
    d = a;
    x = 1;
    y = 0;
  } else {
    extended_gcd(b, a % b);
    int temp = y;
    y = x - y * (a / b);
    x = temp;
  }
}
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int lcm(int a, int b) { return a * (b / gcd(a, b)); }
int getmod(int x, int y, int mod) { return (((x - y) % mod) + mod) % mod; }
vector<string> split(string line, char dil) {
  vector<string> tokens;
  stringstream check1(line);
  string intermediate;
  while (getline(check1, intermediate, dil)) {
    tokens.push_back(intermediate);
  }
  return tokens;
}
void read(vector<long long>& v) {
  for (int i = 0; i < v.size(); i++) cin >> v[i];
}
void solve() {
  int n;
  cin >> n;
  vector<long long> v(n);
  read(v);
  map<long long, vector<long long> > m;
  for (int i = 0; i < n; i++) {
    m[v[i]].push_back(i + 1);
  }
  if (m.size() == 1) {
    cout << "NO\n";
    return;
  }
  auto ptr = m.begin();
  long long first_type = (*ptr).second[0];
  ptr++;
  long long second_type = (*ptr).second[0];
  set<vector<long long> > ans;
  vector<long long> temp(2);
  while (ptr != m.end()) {
    vector<long long> curr = (*ptr).second;
    for (auto x : curr) {
      temp[0] = x;
      temp[1] = first_type;
      sort(temp.begin(), temp.end());
      ans.insert(temp);
    }
    ptr++;
  }
  vector<long long> curr = (*m.begin()).second;
  for (auto x : curr) {
    temp[0] = x;
    temp[1] = second_type;
    sort(temp.begin(), temp.end());
    ans.insert(temp);
  }
  assert(ans.size() == n - 1);
  cout << "YES\n";
  for (auto x : ans) {
    cout << x[1] << " " << x[0] << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> _;
  while (_--) {
    solve();
  }
  return 0;
}
