Statement : C1. We Be Flipping (Easy Version)
This is the easy version of the problem. The difference between the versions is that in this version, you must minimise the sum. You can hack only if you solved all versions of this problem.
You have an array $a$ of length $n$ which consists of non-zero (but possibly negative) integers. You will perform the following operation at most $n$ times (possibly none):
- select an index $i$ ($1 \le i \le n$) such that $a_i \gt 0$
- then for each $j$ where $1 \le j \le i$ do $a_j := -a_j$.
Output a valid sequence of operations of length at most $n$ which $\color{red}{\text{minimises}}$ the sum of $a$ at the end.
Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 10^4$). The description of the test cases follows.
The first line of each testcase contains an integer $n$ ($2 \le n \le 2 \cdot 10^5$) — the length of the array $a$.
The second line of each testcase contains $n$ integers $a_1,a_2,\ldots,a_n$ ($-10^9 \le a_i \le 10^9, a_i \ne 0$).
It is guaranteed that the sum of $n$ over all test cases does not exceed $2 \cdot 10^5$.
For each testcase, output a single integer $k$ ($0 \le k \le n$) — the number of operations you will perform.
Now output $k$ integers $b_1,\ldots,b_k$ where $b_i$ is the index you perform the $i$th operation on.
After performing the operations, the sum of $a$ should be minimal.
Input
3
5
-1 -2 -3 -5 -4
5
-1 -2 3 -5 4
4
5 7 10 19
Output
0
4
3 5 4 2
1
4
Note
In the first testcase, the sum is already minimised. So no operations are required.
In the second testcase, the operations are made as follows:
- $[-1, -2, 3, -5, 4] \xrightarrow{i = 3} [\color{red}{1, 2, -3}, -5, 4]$
- $[1, 2, -3, -5, 4] \xrightarrow{i = 5} [\color{red}{-1, -2, 3, 5, -4}]$
- $[-1, -2, 3, 5, -4] \xrightarrow{i = 4} [\color{red}{1, 2, -3, -5}, -4]$
- $[1, 2, -3, -5, -4] \xrightarrow{i = 2} [\color{red}{-1, -2}, -3, -5, -4]$
This has a sum of $-15$, which is the minimum possible.