#include <bits/stdc++.h>
using namespace std;
void fun2(long long int a[], long long int n) {
  for (long long int i = 0; i < n; i++) cout << a[i] << " ";
  cout << "\n";
}
void fun(long long int a[], long long int n) {
  for (long long int i = 0; i < n; i++) cin >> a[i];
}
void vec(vector<long long int> &v, long long int n) {
  for (long long int i = 0; i < n; i++) {
    long long int x, z;
    cin >> x;
    v.push_back(x);
  }
}
void vec2(vector<long long int> &v) {
  for (auto i = v.begin(); i != v.end(); ++i) cout << *i << " ";
  cout << "\n";
}
void vecr(vector<long long int> &v) {
  for (auto i = v.rbegin(); i != v.rend(); ++i) cout << *i << " ";
  cout << "\n";
}
void set1(set<long long int> &s, long long int &n) {
  for (long long int i = 0; i < n; i++) {
    long long int x, z;
    cin >> x;
    s.insert(x);
  }
}
void set2(set<long long int> &s) {
  for (auto i = s.begin(); i != s.end(); ++i) cout << *i << " ";
  cout << "\n";
}
long long int max(long long int a, long long int b) {
  if (a > b)
    return a;
  else
    return b;
}
long long int min(long long int a, long long int b) {
  if (a > b)
    return b;
  else
    return a;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  cin >> t;
  while (t--) {
    long long int p, q, max = 0, ans = 0, s = 0, z, n;
    cin >> n;
    long long int a[n], b[n], l = 0;
    fun(a, n);
    p = a[n - 1];
    for (long long int i = 0; i < n - 1; i++) {
      if (a[i] != a[i + 1]) {
        s = 1;
        break;
      }
    }
    if (s == 0) {
      cout << "NO";
      cout << "\n";
      continue;
    }
    for (long long int i = 0; i < n; i++) {
      if (a[i] != p) {
        q = a[i];
        l = i + 1;
        break;
      }
    }
    cout << "YES\n";
    for (long long int i = 0; i < n - 1; i++) {
      cout << i + 1 << " ";
      if (a[i] != q)
        cout << l << " ";
      else
        cout << n << " ";
      cout << "\n";
    }
  }
  return 0;
}
