#include <bits/stdc++.h>
using namespace std;
long long n, m, k, t, x, y, z, w, ct, ans, f;
string s, l;
long long a[200005];
set<long long> si;
queue<long long> qi;
map<long long, long long> mi;
vector<long long> vi;
priority_queue<long long> pqdi;
priority_queue<long long, vector<long long>, greater<long long>> pqai;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cerr.tie(NULL);
  cin >> t;
  while (t--) {
    si.clear();
    vi.clear();
    cin >> n;
    for (long long i = 1; i <= n; i++) {
      cin >> a[i];
      si.insert(a[i]);
    }
    if (si.size() != n) {
      cout << "NO"
           << "\n";
    } else {
      f = 0;
      vector<long long> diff;
      sort(a + 1, a + n + 1);
      for (long long i = 2; i < n + 1; i++) {
        for (long long j = 1; j < i; j++) {
          diff.push_back(a[i] - a[j]);
        }
      }
      long long valid[1000000];
      long long j = 2;
      memset(valid, 0, sizeof(valid));
      vi.push_back(1);
      valid[1] = 1;
      for (long long i = 1; i < n; i++) {
        for (auto it : diff) {
          valid[(vi[i - 1] + it)] = 1;
        }
        while (valid[j]) j++;
        vi.push_back(j);
        valid[j] = 1;
        if (j > 1000000) {
          f = 1;
          break;
        }
      }
      if (f)
        cout << "NO"
             << "\n";
      else {
        cout << "YES"
             << "\n";
        ;
        for (long long i = 1; i <= n; i++) cout << vi[i - 1] << " ";
        cout << "\n";
      }
    }
  }
}
