#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    scanf("%d", &n);
    vector<int> a(n);
    for (int &x : a) scanf("%d", &x);
    vector<vector<int>> ans;
    bool ok = false;
    for (int i = 1; i < n; i++) {
      ok |= (a[i] != a[i - 1]);
    }
    if (!ok) {
      printf("NO\n");
      continue;
    }
    int head = a[0];
    for (int i = 1; i < n; i++) {
      if (a[i] != head) {
        ans.push_back({1, i + 1});
      }
    }
    int id = 1;
    while (id < n && a[id] == a[0]) id++;
    for (int i = 1; i < n; i++) {
      if (a[i] == a[0]) ans.push_back({id + 1, i + 1});
    }
    printf("YES\n");
    for (vector<int> &T : ans) printf("%d %d\n", T[0], T[1]);
  }
  return 0;
}
