#include <bits/stdc++.h>
using namespace std;
bool myf(pair<int, int> a, pair<int, int> b) {
  if (a.first < b.first) return true;
  return false;
}
pair<long long int, long long int> findDiv(long long int a, long long int x) {
  long long int m = a, k = 0, flag = 0;
  while (m > 0) {
    if (m % x == 0) {
      k++;
      m = m / x;
    } else {
      flag = 1;
      break;
    }
  }
  return make_pair(flag, k);
}
vector<int> prime(100001, 1);
void ctorsieve(long long int n) {
  for (int i = 2; i <= sqrt(n); i++) {
    if (prime[i] == 1) {
      for (int j = i * i; j <= n; j += i) {
        prime[j] = 0;
      }
    }
  }
}
int main() {
  long long int t, n, i, j, ans, dig, d, num, flag = 0, k, m, l, q, b, mx, x, y;
  cin >> t;
  while (t--) {
    cin >> n;
    vector<long long int> a(n), c;
    vector<pair<long long int, long long int>> vec;
    for (i = 0; i < n; i++) cin >> a[i];
    unordered_map<long long int, vector<long long int>> mp;
    for (i = 0; i < n; i++) {
      if (mp.find(a[i]) != mp.end())
        mp[a[i]].push_back(i + 1);
      else {
        vector<long long int> p;
        p.push_back(i + 1);
        mp.insert(make_pair(a[i], p));
      }
    }
    for (auto it = mp.begin(); it != mp.end(); it++) {
      c.push_back(it->second[0]);
    }
    for (i = 0; i < c.size() - 1; i++) {
      vec.push_back(make_pair(c[i], c[i + 1]));
    }
    for (auto it = mp.begin(); it != mp.end(); it++) {
      if (it->second.size() != 1) {
        auto dit = mp.begin();
        j = 1;
        while (it->second.size() > 1 && dit != mp.end()) {
          if (dit == it) {
            dit++;
            continue;
          }
          vec.push_back(make_pair(dit->second[0], it->second[1]));
          it->second.erase(it->second.begin() + 1);
        }
      }
    }
    flag = 0;
    for (auto it = mp.begin(); it != mp.end(); it++) {
      if (it->second.size() != 1) {
        flag = 1;
        break;
      }
    }
    if (flag == 1)
      cout << "NO\n";
    else {
      cout << "YES\n";
      for (i = 0; i < vec.size(); i++) {
        cout << vec[i].first << ' ' << vec[i].second << '\n';
      }
    }
  }
}
