#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double eps = 1e-6;
const long long mod = 1e9 + 7;
const int inf = 0x3f3f3f3f;
const int maxn = 3e5 + 10;
const int maxm = 100 + 10;
int n, m;
int a[maxn];
struct node {
  int u, v;
} ans[5020];
vector<int> e[5020];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int t;
  cin >> t;
  while (t--) {
    cin >> n;
    map<int, int> mm;
    mm.clear();
    int k = 1;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      if (mm[a[i]] == 0) {
        mm[a[i]] = k;
        k++;
      }
    }
    if (k <= 2) {
      cout << "NO" << endl;
      continue;
    }
    for (int i = 1; i <= k; i++) {
      e[i].clear();
    }
    for (int i = 1; i <= n; i++) {
      int tt = mm[a[i]];
      e[tt].push_back(i);
    }
    cout << "YES" << endl;
    int u = e[1][0];
    for (int i = 2; i < k; i++) {
      for (int j = 0; j < e[i].size(); j++) {
        cout << u << " " << e[i][j] << endl;
      }
    }
    for (int i = 1; i < e[1].size(); i++) {
      cout << e[k - 1][0] << " " << e[1][i] << endl;
    }
  }
}
