---
{"category_name":"medium","problem_code":"RESTCH","problem_name":"Chef, Chefina and Restoration","problemComponents":{"constraints":"","constraintsState":false,"subtasks":"","subtasksState":false,"inputFormat":"","inputFormatState":false,"outputFormat":"","outputFormatState":false,"sampleTestCases":{"0":{"id":1,"input":"4\r\n2\r\n1 2\r\n3\r\n-1 -2 -3\r\n4\r\n3 3 3 4\r\n4\r\n4 -4 4 -4","output":"YES\r\n2 1\r\nNO\r\nNO\r\nYES\r\n4 -4 4 -4","explanation":"**Example case 1:** The only two permutations of $B$ are $[1,2]$ and $[2,1]$. Out of them, $[1,2]$ could not have been generated by Chefina, since it would require $A = [1,-1]$, which contains a negative element. On the other hand, for $[2,1]$, we get $A = [2,1]$, so $F = [2,1]$ must be the sequence Chefina generated.","isDeleted":false}}},"video_editorial_url":"","languages_supported":{"0":"CPP14","1":"C","2":"JAVA","3":"PYTH 3.6","4":"CPP17","5":"PYTH","6":"PYP3","7":"CS2","8":"ADA","9":"PYPY","10":"TEXT","11":"PAS fpc","12":"NODEJS","13":"RUBY","14":"PHP","15":"GO","16":"HASK","17":"TCL","18":"PERL","19":"SCALA","20":"LUA","21":"kotlin","22":"BASH","23":"JS","24":"LISP sbcl","25":"rust","26":"PAS gpc","27":"BF","28":"CLOJ","29":"R","30":"D","31":"CAML","32":"FORT","33":"ASM","34":"swift","35":"FS","36":"WSPC","37":"LISP clisp","38":"SQL","39":"SCM guile","40":"PERL6","41":"ERL","42":"CLPS","43":"ICK","44":"NICE","45":"PRLG","46":"ICON","47":"COB","48":"SCM chicken","49":"PIKE","50":"SCM qobi","51":"ST","52":"SQLQ","53":"NEM"},"max_timelimit":2,"source_sizelimit":50000,"problem_author":"dean_student","problem_tester":null,"date_added":"21-06-2020","tags":{"0":"dean_student","1":"greedy","2":"ltime85","3":"medium","4":"order","5":"taran_1407"},"problem_difficulty_level":"Medium-Hard","best_tag":"Order Statistic","editorial_url":"https://discuss.codechef.com/problems/RESTCH","time":{"view_start_date":1593277202,"submit_start_date":1593277202,"visible_start_date":1593277202,"end_date":1735669800},"is_direct_submittable":false,"problemDiscussURL":"https://discuss.codechef.com/search?q=RESTCH","is_proctored":false,"visitedContests":{},"layout":"problem"}
---
### Read problem statements in [Hindi](https://www.codechef.com/download/translated/LTIME85/hindi/RESTCH.pdf), [Bengali](https://www.codechef.com/download/translated/LTIME85/bengali/RESTCH.pdf), [Mandarin Chinese](https://www.codechef.com/download/translated/LTIME85/mandarin/RESTCH.pdf), [Russian](https://www.codechef.com/download/translated/LTIME85/russian/RESTCH.pdf), and [Vietnamese](https://www.codechef.com/download/translated/LTIME85/vietnamese/RESTCH.pdf) as well.
Chefina gave Chef a sequence $F_1, F_2, \ldots, F_N$ as a birthday present. She constructed it from a sequence of positive integers $A_1, A_2, \ldots, A_N$ in the following way: for each valid $i$, $F_i = \sum_{j=1}^i (-1)^{(j+1)} \cdot A_j$.
Unfortunately, Chef was playing with the sequence $F$ and shuffled it. Now, he has a sequence denoted by $B$, but he does not remember $F$. The only things he knows are that $F$ is a permutation of $B$ and among all such permutations which Chefina could have constructed, her sequence $F$ was the lexicographically smallest.
Chef does not want to disappoint Chefina, but he is too busy in the kitchen, so he asked you to help him recover $F$. Find the sequence $F$ he got from Chefina or determine that he made another mistake and a sequence that satisfies the given conditions does not exist.
### Input
- The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.
- The first line of each test case contains a single integer $N$.
- The second line contains $N$ space-separated integers $B_1, B_2, \ldots, B_N$.
### Output
For each test case:
- If there is no solution, print a single line containing the string `"NO"` (without quotes).
- Otherwise, print two lines.
- The first of these lines should contain the string `"YES"` (without quotes).
- The second line should contain $N$ space-separated integers $F_1, F_2, \ldots, F_N$.
### Constraints
- $1 \le T \le 10,000$
- $1 \le N \le 10^5$
- $|B_i| \le 10^9$ for each valid $i$
- the sum of $N$ over all test cases does not exceed $10^6$
### Subtasks
**Subtask #1 (50 points):** $B_1, B_2, \ldots, B_N$ are pairwise distinct
**Subtask #2 (50 points):** original constraints
### Example Input
```
4
2
1 2
3
-1 -2 -3
4
3 3 3 4
4
4 -4 4 -4
```
### Example Output
```
YES
2 1
NO
NO
YES
4 -4 4 -4
```
### Explanation
**Example case 1:** The only two permutations of $B$ are $[1,2]$ and $[2,1]$. Out of them, $[1,2]$ could not have been generated by Chefina, since it would require $A = [1,-1]$, which contains a negative element. On the other hand, for $[2,1]$, we get $A = [2,1]$, so $F = [2,1]$ must be the sequence Chefina generated.
<aside style='background: #f8f8f8;padding: 10px 15px;'><div>All submissions for this problem are available.</div></aside>