#include <bits/stdc++.h>
using namespace std;
int T;
int n;
int a[111], b[111];
bool f[1001001];
bool chk(int i) {
  for (int j = 1; j < i; j++)
    if (f[b[i] - b[j]]) return false;
  return true;
}
int main() {
  memset(f, false, sizeof f);
  for (scanf("%d", &T); T--;) {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    sort(a + 1, a + n + 1);
    for (int i = 2; i <= n; i++)
      for (int j = 1; j < i; j++) f[a[i] - a[j]] = true;
    b[1] = 1;
    for (int i = 2; i <= n; i++) {
      b[i] = b[i - 1] + 1;
      while (!chk(i)) b[i]++;
    }
    puts("YES");
    for (int i = 1; i <= n; i++) printf("%d%c", b[i], i < n ? ' ' : '\n');
    for (int i = 2; i <= n; i++)
      for (int j = 1; j < i; j++) f[a[i] - a[j]] = false;
  }
  return 0;
}
