#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long a[n];
    long long vis[5001] = {0};
    map<long long, long long> mp;
    vector<pair<long long, long long>> v;
    set<long long> s;
    for (long long i = 0; i < n; ++i) {
      cin >> a[i];
      mp[a[i]]++;
      s.insert(a[i]);
      v.push_back({a[i], i});
    }
    if (s.size() == 1) {
      cout << "NO"
           << "\n";
      continue;
    }
    cout << "YES"
         << "\n";
    vector<pair<long long, long long>> path;
    for (long long i = 0; i < v.size() - 1; ++i) {
      for (long long j = i + 1; j < n; ++j) {
        long long v1 = v[i].second;
        long long v2 = v[j].second;
        if (vis[i] == 1 && vis[j] == 1) {
          break;
        }
        if (!vis[i] && !vis[j]) {
          if (v[i].first != v[j].first) {
            path.push_back({v1 + 1, v2 + 1});
            vis[v1] = 1;
            vis[v2] = 1;
          }
        } else {
          if (v[i].first != v[j].first) {
            path.push_back({v2 + 1, v1 + 1});
            vis[v1] = 1;
            vis[v2] = 1;
          }
        }
      }
    }
    for (auto &i : path) {
      cout << i.first << " " << i.second << "\n";
    }
  }
}
