#include <bits/stdc++.h>
const int N = 2e5 + 100, M = 1e6 + 100, second = 1e2 + 100;
const long long mod = 1e9 + 7, MOD = 1e9 + 9, Mod = 1e8;
const long long INF = 1e9, inf = 1e18;
const long double Pi = (22 * 1.0) / (7 * 1.0);
using namespace std;
long long q, n, a[N];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  ;
  cin >> q;
  while (q--) {
    cin >> n;
    long long pos = 1;
    set<long long> have;
    vector<pair<long long, long long> > v;
    for (int i = 1; i <= n; i++) cin >> a[i], have.insert(a[i]);
    if (have.size() == 1) {
      cout << "NO" << endl;
      continue;
    }
    long long des = 0;
    have.clear();
    for (int i = 2; i <= n; i++) {
      if (a[1] != a[i])
        v.push_back({1ll, i}), des = i;
      else
        have.insert(i);
    }
    while (have.size())
      v.push_back({*have.begin(), des}), have.erase(*have.begin());
    cout << "YES" << endl;
    for (auto x : v) cout << x.first << ' ' << x.second << endl;
  }
}
