B. Tim the Marksman
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Tim the Busy Beaver has signed up for a pistol class in order to pass their PE requirement and wants to be an elite marksman. The MIT shooting range has $$$N$$$ $$$(1 \leq N \leq 3 \cdot 10^5)$$$ lanes numbered from $$$1$$$ to $$$N$$$. Lane $$$i$$$ currently has $$$A_i$$$ $$$(0 \leq A_i \leq 5 \cdot 10^5)$$$ targets lined up in a row. It is guaranteed that there is at least one target in the entire range.

Tim's practice gun has an infinite number of bullets, and he needs to shoot down every target. Before each shot, Tim will pick a lane and fire $$$1$$$ shot down that lane. Once a target is hit, it will be knocked down and will never come back up.

However, Tim's aim is terrible, so every odd-numbered shot will hit the first target in the lane, while every even-numbered shot will miss the first target in the lane and hit the second one (if it exists). The first shot is shot $$$1$$$.

Tim is not allowed to fire a shot that does not hit any target, as it would damage the wall behind the targets. Help Tim find a sequence of shots that will knock down every target, or state that no such sequence exists.

Input

Each test contains multiple test cases. The first line contains a single integer $$$t$$$ $$$(1 \leq t \leq 1000)$$$: the number of test cases. The description of the test cases follows.

Each of the $$$t$$$ testcases consists of $$$2$$$ lines. The first line contains $$$N$$$, the number of lanes. The second line contains $$$N$$$ spaced integers $$$A_1,A_2,\cdots, A_n$$$, indicating the number of targets in each lane.

It is guaranteed that the sum of $$$A_i$$$ across all test cases is no more than $$$5\cdot 10^5$$$.

It is guaranteed that the sum of $$$N$$$ across all test cases is no more than $$$3 \cdot 10^5$$$.

Output

For each testcase, output "YES" if there exists a sequence of shots that hits every target, or "NO" if no such sequence exists. You can output the answer in any case (upper or lower). For example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as positive responses.

Let $$$A$$$ be the sum of $$$A_i$$$ in the testcase (note that $$$A$$$ may be different for different test cases). If such a sequence exists, output on a separate line a sequence of $$$A$$$ space-separated integers $$$l_1,l_2,\cdots, l_A$$$, where $$$l_i$$$ is the lane that Wabbit should fire the $$$i$$$-th shot at. If there are multiple solutions, print any of them.

Scoring

You will receive $$$50\%$$$ of the points for each subtask if the YES/NO responses are correct, but the provided values of $$$l_i$$$ are not. For each testcase, you must output exactly $$$A$$$ values of $$$l_i$$$ for partial credit.

  • ($$$30$$$ points): The sum of $$$N$$$ across all test cases does not exceed $$$2000$$$, and the sum of $$$A_i$$$ across all test cases does not exceed $$$2000$$$.
  • ($$$70$$$ points): No additional constraints.
Example
Input
3
1
3
1
2
5
1 1 1 1 1
Output
YES
1 1 1 
NO
NO
Note

In the first test case, there is only $$$1$$$ lane with $$$3$$$ targets, and Wabbit can knock down all targets by firing 3 shots at lane $$$1$$$. If the targets are $$$A,B$$$ and $$$C$$$ from front to back, the first shot will knock down $$$A$$$, the second shot will miss $$$B$$$ and knock down $$$C$$$, and the last shot will knock down $$$B$$$.

In the second test case, there is only $$$1$$$ lane with $$$2$$$ targets. The first shot at lane $$$1$$$ will hit the front target, but the second shot will not knock down the remaining target as it will miss. Thus, no sequence of shots exists for this test case.

In the third test case, there are $$$5$$$ lanes with $$$1$$$ target each. The first shot at any lane will hit the target at that lane, but the second shot will not be able to hit any other target. Thus, no sequence of shots exists for this test case.