## GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

# [Solution] Make Nonzero Sum (easy version) Codeforces Solution

C1. Make Nonzero Sum (easy version)
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

This is the easy version of the problem. The difference is that in this version the array can not contain zeros. You can make hacks only if both versions of the problem are solved.

You are given an array $\left[{a}_{1},{a}_{2},\dots {a}_{n}\right]$ consisting of integers $-1$ and $1$. You have to build a partition of this array into the set of segments $\left[{l}_{1},{r}_{1}\right],\left[{l}_{2},{r}_{2}\right],\dots ,\left[{l}_{k},{r}_{k}\right]$ with the following property:

• Denote the alternating sum of all elements of the $i$-th segment as ${s}_{i}$${s}_{i}$ = ${a}_{{l}_{i}}-{a}_{{l}_{i}+1}+{a}_{{l}_{i}+2}-{a}_{{l}_{i}+3}+\dots ±{a}_{{r}_{i}}$. For example, the alternating sum of elements of segment $\left[2,4\right]$ in array $\left[1,0,-1,1,1\right]$ equals to $0-\left(-1\right)+1=2$.
• The sum of ${s}_{i}$ over all segments of partition should be equal to zero.

Note that each ${s}_{i}$ does not have to be equal to zero, this property is about sum of ${s}_{i}$ over all segments of partition.

The set of segments $\left[{l}_{1},{r}_{1}\right],\left[{l}_{2},{r}_{2}\right],\dots ,\left[{l}_{k},{r}_{k}\right]$ is called a partition of the array $a$ of length $n$ if $1={l}_{1}\le {r}_{1},{l}_{2}\le {r}_{2},\dots ,{l}_{k}\le {r}_{k}=n$ and ${r}_{i}+1={l}_{i+1}$ for all $i=1,2,\dots k-1$. In other words, each element of the array must belong to exactly one segment.

You have to build a partition of the given array with properties described above or determine that such partition does not exist.

Note that it is not required to minimize the number of segments in the partition.

Input

Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1\le t\le 10\phantom{\rule{thinmathspace}{0ex}}000$). Description of the test cases follows.

The first line of each test case contains an integer $n$ ($1\le n\le 200\phantom{\rule{thinmathspace}{0ex}}000$) — the length of the array $a$.

The second line of each test case contains $n$ integers ${a}_{1},{a}_{2},\dots ,{a}_{n}$ (${a}_{i}$ is $-1$ or $1$) — the elements of the given array.

It's guaranteed that the sum of $n$ over all test cases does not exceed $200\phantom{\rule{thinmathspace}{0ex}}000$.

Output

For each test case, if required partition does not exist, print $-1$. Otherwise, print an integer $k$ — the number of segments in the partition.

Then in the $i$-th of the following $k$ lines print two integers ${l}_{i}$ and ${r}_{i}$ — description of the $i$-th segment. The following conditions should be satisfied:

• ${l}_{i}\le {r}_{i}$ for each $i$ from $1$ to $k$.
• ${l}_{i+1}={r}_{i}+1$ for each $i$ from $1$ to $\left(k-1\right)$.
• ${l}_{1}=1,{r}_{k}=n$.

If there are multiple correct partitions of the array, print any of them.

Note

In the first test case we can build a partition of one segment of length $4$. The sum of this segment will be equal to $1-1+1-1=0$.

In the second test case we can build a partition of two segments of length $3$. The sum of the first segment will be equal to $-1-1+1=-1$, and the sum of the second segment: $1-1+1=1$. So, the total sum will be equal to $-1+1=0$.

In the third and in the fourth test cases it can be proved that there are no required partition.