#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool sortbyval(const pair<long long, long long> &a,
               const pair<long long, long long> &b) {
  return (a.second < b.second);
}
bool sortbyth(const tuple<long long, long long, long long> &a,
              const tuple<long long, long long, long long> &b) {
  return get<1>(a) < get<1>(b);
}
bool p[1000000];
void sieve() {
  memset(p, true, sizeof(p));
  p[0] = false;
  p[1] = false;
  for (long long i = 2; i * i <= 1000000; i++) {
    if (p[i] == true) {
      for (long long j = i * i; j <= 1000000; j += i) {
        if (p[j] == true) p[j] = false;
      }
    }
  }
}
long long powr(long long n, long long m) {
  if (m == 0) return 1;
  long long temp = powr(n, m / 2) % 1000000007;
  if (m & 1) {
    return ((temp * temp) % 1000000007 * n % 1000000007) % 1000000007;
  } else {
    return (temp * temp) % 1000000007;
  }
}
long long pown(long long a, long long b) {
  long long r = 1;
  while (b) {
    if (b % 2 == 1) {
      r = (r * a) % 1000000007;
    }
    b /= 2;
    a = (a * a) % 1000000007;
  }
  return r;
}
long long fact(long long n) {
  if (n == 0 or n == 1) return 1;
  return n * fact(n - 1);
}
long long power(long long x, long long n, long long M) {
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return power((x * x) % M, n / 2, M);
  else
    return (x * power((x * x) % M, (n - 1) / 2, M)) % M;
}
long long d, x, y;
void exteuclid(long long a, long long m) {
  if (m == 0) {
    d = a;
    x = 1;
    y = 0;
  } else {
    exteuclid(m, a % m);
    long long temp = x;
    x = y;
    y = temp - (a / m) * y;
  }
}
long long modinverse(long long a, long long m) {
  exteuclid(a, m);
  return (x % m + m) % m;
}
long long modinv2(long long a, long long m) { return power(a, m - 2, m); }
void solve() {
  long long n;
  cin >> n;
  vector<long long> v(n);
  for (long long i = 0; i < n; i++) {
    cin >> v[i];
  };
  long long ct = 1;
  for (long long i = 0; i < n - 1; i++) {
    if (v[i] != v[i + 1]) ct++;
  }
  if (ct == 1) {
    cout << "NO"
         << "\n";
  } else {
    cout << "YES"
         << "\n";
    vector<long long> o, t;
    for (long long i = 1; i < n; i++) {
      if (v[i] != v[0])
        o.push_back(i + 1);
      else
        t.push_back(i + 1);
    }
    for (long long i : o) {
      cout << 1 << " " << i << "\n";
    }
    for (long long i : t) {
      cout << o[0] << " " << i << "\n";
    }
  }
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) {
    solve();
  }
}
