#include <bits/stdc++.h>
using namespace std;
pair<int, int> a[300010] = {};
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    for (int i = 1; i <= n; ++i) cin >> a[i].first, a[i].second = i;
    sort(a + 1, a + n + 1);
    if (a[1].first == a[n].first) {
      cout << "NO\n";
      continue;
    }
    int x = 2;
    while (a[x].first == a[1].first) ++x;
    cout << "YES\n";
    for (int i = 1; i < x; ++i)
      cout << a[i].second << " " << a[x].second << "\n";
    for (int i = x + 1; i <= n; ++i)
      cout << a[1].second << " " << a[i].second << "\n";
  }
}
