CF1323A.Even Subset Sum Problem

传统题 时间 2000 ms 内存 256 MiB 3 尝试 1 已通过 1 标签

Even Subset Sum Problem

You are given an array aa consisting of nn positive integers. Find a non-empty subset of its elements such that their sum is even (i.e. divisible by 22) or determine that there is no such subset.

Both the given array and required subset may contain equal values.

Input

The first line contains a single integer tt (1t1001 \leq t \leq 100), number of test cases to solve. Descriptions of tt test cases follow.

A description of each test case consists of two lines. The first line contains a single integer nn (1n1001 \leq n \leq 100), length of array aa.

The second line contains nn integers a1,a2,,ana_1, a_2, \ldots, a_n (1ai1001 \leq a_i \leq 100), elements of aa. The given array aa can contain equal values (duplicates).

Output

For each test case output 1-1 if there is no such subset of elements. Otherwise output positive integer kk, number of elements in the required subset. Then output kk distinct integers (1pin1 \leq p_i \leq n), indexes of the chosen elements. If there are multiple solutions output any of them.

Note

There are three test cases in the example.

In the first test case, you can choose the subset consisting of only the second element. Its sum is 44 and it is even.

In the second test case, there is only one non-empty subset of elements consisting of the first element, however sum in it is odd, so there is no solution.

In the third test case, the subset consisting of all array's elements has even sum.

Samples

3
3
1 4 3
1
15
2
3 5
1
2
-1
2
1 2

在线编程 IDE

建议全屏模式获得最佳体验