CF856A.Set Theory

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Masha and Grisha like studying sets of positive integers.

One day Grisha has written a set AA containing nn different integers aia_{i} on a blackboard. Now he asks Masha to create a set BB containing nn different integers bjb_{j} such that all n2n^{2} integers that can be obtained by summing up aia_{i} and bjb_{j} for all possible pairs of ii and jj are different.

Both Masha and Grisha don't like big numbers, so all numbers in AA are from 11 to 10610^{6} , and all numbers in BB must also be in the same range.

Help Masha to create the set BB that satisfies Grisha's requirement.

输入格式

Input data contains multiple test cases. The first line contains an integer tt — the number of test cases ( 1<=t<=1001<=t<=100 ).

Each test case is described in the following way: the first line of the description contains one integer nn — the number of elements in AA ( 1<=n<=1001<=n<=100 ).

The second line contains nn integers aia_{i} — the elements of AA ( 1<=ai<=1061<=a_{i}<=10^{6} ).

输出格式

For each test first print the answer:

  • NO, if Masha's task is impossible to solve, there is no way to create the required set BB .
  • YES, if there is the way to create the required set. In this case the second line must contain nn different positive integers bjb_{j} — elements of BB ( 1<=bj<=1061<=b_{j}<=10^{6} ). If there are several possible sets, output any of them.

输入输出样例

  • 输入#1

    3
    3
    1 10 100
    1
    1
    2
    2 4
    

    输出#1

    YES
    1 2 3 
    YES
    1 
    YES
    1 2 
    
首页