#include <bits/stdc++.h>
using namespace std;
long long int ESP = 1e18;
bool isPrime[5000005];
void sieve(long long int N) {
  for (long long int i = 0; i <= N; ++i) {
    isPrime[i] = true;
  }
  isPrime[0] = false;
  isPrime[1] = false;
  for (int i = 2; i * i <= N; ++i) {
    if (isPrime[i] == true) {
      for (int j = i * i; j <= N; j += i) isPrime[j] = false;
    }
  }
}
bool anagram(char *s1, char *s2) {
  long long int count[256];
  memset(count, 0, sizeof(count));
  long long int i;
  for (i = 0; s1[i] && s2[i]; i++) {
    count[s1[i]]++;
    count[s2[i]]--;
  }
  if (s1[i] || s2[i]) {
    return false;
  }
  for (long long int i = 0; i < 256; i++) {
    if (count[i]) {
      return false;
    }
  }
  return true;
}
int find_largest_digit(int n) {
  int mx = 0;
  while (n > 0) {
    mx = max(mx, n % 10);
    n /= 10;
  }
  return mx;
}
long long int no_of_digits(long long int n) {
  long long int ans = 0;
  while (n > 0) {
    ans++;
    n /= 10;
  }
  return ans;
}
long long int moduloMultiplication(long long int a, long long int b,
                                   long long int zz) {
  long long int res = 0;
  a %= zz;
  while (b) {
    if (b & 1) res = (res + a) % zz;
    a = (2 * a) % zz;
    b >>= 1;
  }
  return res;
}
long long int convert(string s) {
  bool o = true;
  long long int ans = 0;
  for (long long int i = 0; i < s.length(); i++) {
    ans = ans * 10 + (s[i] - 48);
  }
  return ans;
}
inline long long int powmod(long long int a, long long int b,
                            long long int modulo) {
  if (b == 0 || a == 1) return 1;
  long long int half = powmod(a, (b / 2), modulo) % modulo;
  long long int full = (half * half) % modulo;
  if (b % 2) return (full * a) % modulo;
  return full % modulo;
}
long long int poww(long long int a, long long int b) {
  if (b == 0 || a == 1) return 1;
  long long int half = poww(a, (b / 2));
  if (half < 0 || half > ESP) return -1;
  long long int full = (half * half);
  if (half != 0 && full / half != half) {
    return -1;
  }
  if (b % 2) {
    if (full * a < 0 || full * a > ESP) return -1;
  }
  if (full < 0 || full > ESP) return -1;
  if (b % 2) {
    long long int x = a * full;
    if (a != 0 && x / a != full) {
      return -1;
    }
    return (x);
  }
  return full;
}
long long int invmod(long long int a, long long int modulo) {
  long long int check = powmod(a, modulo - 2, modulo) % modulo;
  return check;
}
long long int max(long long int a, long long int b) {
  if (a > b) {
    return a;
  }
  return b;
}
long long int min(long long int a, long long int b) {
  if (a < b) {
    return a;
  }
  return b;
}
long long int min(long long int a, int b) {
  if (a < b) return a;
  return b;
}
long long int min(int a, long long int b) {
  if (a < b) return a;
  return b;
}
long long int max(long long int a, int b) {
  if (a > b) return a;
  return b;
}
long long int max(int a, long long int b) {
  if (a > b) return a;
  return b;
}
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
  return a / gcd(a, b) * b;
}
void yes() {
  cout << "YES"
       << "\n";
}
void no() {
  cout << "NO"
       << "\n";
}
vector<int> factorize(int n) {
  vector<int> res;
  for (int i = 2; i * i <= n; ++i) {
    while (n % i == 0) {
      res.push_back(i);
      n /= i;
    }
  }
  if (n != 1) {
    res.push_back(n);
  }
  return res;
}
void printDivisors(int n) {
  for (int i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i)
        printf("%d ", i);
      else
        printf("%d %d ", i, n / i);
    }
  }
}
int phi(int n) {
  int result = n;
  for (int p = 2; p * p <= n; ++p) {
    if (n % p == 0) {
      while (n % p == 0) n /= p;
      result -= result / p;
    }
  }
  if (n > 1) result -= result / n;
  return result;
}
long long prr[] = {2,   3,   5,   7,   11,  13,  17,  19,  23,  29,  31,  37,
                   41,  43,  47,  53,  59,  61,  67,  71,  73,  79,  83,  89,
                   97,  101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151,
                   157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223,
                   227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281,
                   283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359,
                   367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433,
                   439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499};
long chocolate(vector<int> arr) {
  int n = arr.size();
  vector<long> ans(n, 1);
  for (int i = 1; i < n; i++) {
    if (arr[i] > arr[i - 1])
      ans[i] = ans[i - 1] + 1;
    else if (arr[i] == arr[i - 1])
      ans[i] = ans[i - 1];
  }
  long int count = ans[n - 1];
  for (int j = n - 2; j >= 0; j--) {
    if (arr[j] > arr[j + 1]) ans[j] = max(ans[j], ans[j + 1] + 1);
    count += ans[j];
  }
  for (auto x : ans) cout << x << " ";
  cout << "\n";
  ;
  return count;
}
void solve() {
  long long int n;
  cin >> n;
  priority_queue<long long int> pq1, pq2;
  cout << 2 << "\n";
  ;
  if (n == 2) {
    cout << 1 << " " << 2 << "\n";
    ;
    return;
  }
  for (long long int i = 1; i < n + 1; i++) {
    if (i % 2)
      pq2.push(i);
    else
      pq1.push(i);
  }
  {
    for (long long int j = 1; j < n; j++) {
      auto x = pq1.top();
      auto y = pq2.top();
      if (x >= y) {
        auto ans1 = pq1.top();
        pq1.pop();
        auto ans2 = pq1.top();
        pq1.pop();
        cout << ans1 << " " << ans2 << "\n";
        ;
        auto avg = (ans1 + ans2) / 2;
        (avg % 2) ? pq2.push(avg) : pq1.push(avg);
      } else {
        auto ans1 = pq2.top();
        pq2.pop();
        auto ans2 = pq2.top();
        pq2.pop();
        cout << ans1 << " " << ans2 << "\n";
        ;
        auto avg = (ans1 + ans2) / 2;
        (avg % 2) ? pq2.push(avg) : pq1.push(avg);
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  cin >> t;
  long long int a[5] = {0, 1, 3, 6, 10};
  while (t--) {
    long long int n;
    cin >> n;
    map<long long int, vector<long long int>> mp;
    bool f = 0;
    vector<long long int> a(n);
    for (auto i = 0; i < n; i++) {
      cin >> a[i];
      mp[a[i]].push_back(i);
    }
    if (mp.begin()->second.size() == n) {
      no();
      continue;
    }
    yes();
    auto j = mp.begin()->second[0];
    long long int last;
    for (auto i = mp.begin(); i != mp.end(); i++) {
      if (i == mp.begin()) continue;
      vector<long long int> v = i->second;
      for (auto x : v) {
        cout << j + 1 << " " << x + 1 << endl;
        last = x;
      }
    }
    for (auto i = 1; i < mp.begin()->second.size(); i++) {
      cout << last + 1 << " " << mp.begin()->second[i] + 1 << endl;
    }
  }
  return 0;
}
