| TheForces Round #33(Wow-Forces) |
|---|
| Finished |
An array $$$c$$$ of size $$$n$$$ is called Lucky array if it satisfies the following conditions for every $$$i(1 \le i \le n)$$$:
Mr. Wow has constructed a Lucky array $$$a$$$ of size $$$n$$$. Now he wants you to construct a Lucky array $$$b$$$ of size $$$n$$$ such that :
If there is no Lucky array satisfying Mr. Wow's conditions, print $$$-1$$$ instead.
Note that, $$$⌊y⌋$$$ means the largest integer which is not greater than $$$y$$$, i.e., $$$⌊2.75⌋ = 2, ⌊3.99⌋ = 3, ⌊4⌋ = 4$$$.
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 1000$$$). The description of the test cases follows.
The first line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 10^5$$$) — the length of the Lucky array $$$a$$$.
The second line of each test case contains $$$n$$$ space separated integers $$$a_{i}$$$ ($$$0 \le a_{i} \le 1$$$).
It is guaranteed that the given array $$$a$$$ is a Lucky array.
It is guaranteed that the sum of $$$n$$$ over all test cases doesn't exceed $$$10^5$$$.
For each test case, print $$$-1$$$ if there is no Lucky array satisfying Mr. Wow's conditions.
Otherwise, print $$$n$$$ space-separated integers $$$b_i$$$ ($$$0 \le b_{i} \le 1$$$) which satisfy the conditions by Mr. Wow.
51020 140 0 1 050 1 0 0 160 0 0 0 0 0
-1 0 0 0 1 0 1 0 0 1 1 0 0 0 1 1 0 1
| Name |
|---|


