#include <bits/stdc++.h>
using namespace std;
int debug = 1;
int test = 1;
long double pi = 3.14159265358979323846;
inline long long int min2(long long a, long long b) {
  if (a < b) {
    return a;
  }
  return b;
}
inline long long max3(long long a, long long b, long long c) {
  return (a) > (b) ? ((a) > (c) ? (a) : (c)) : ((b) > (c) ? (b) : (c));
}
inline long long min3(long long a, long long b, long long c) {
  return (a) < (b) ? ((a) < (c) ? (a) : (c)) : ((b) < (c) ? (b) : (c));
}
void filereader() {}
int main() {
  debug = 1;
  test = 1;
  filereader();
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> a(n);
    int mx = 0;
    int prev = -1;
    int same = 1;
    map<int, int> cnt;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      cnt[a[i]]++;
      if (prev != -1) {
        if (same and prev == a[i]) {
          same = 1;
        } else {
          same = 0;
        }
      }
      prev = a[i];
    }
    int ref = a[0];
    int ref2 = 0;
    vector<int> v;
    if (same) {
      cout << "NO" << endl;
    } else {
      cout << "YES\n";
      for (int i = 0; i < n; i++) {
        if (a[i] != ref) {
          cout << 1 << " " << i + 1 << endl;
          ref2 = i + 1;
        } else {
          v.push_back(i + 1);
        }
      }
      for (int i = 1; i < cnt[ref]; i++) {
        cout << v[i] << " " << ref2 << endl;
        ;
      }
    }
  }
}
