forked from anandadfoxx/codeforces_solutions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1323A.cpp
More file actions
42 lines (39 loc) · 1 KB
/
Copy path1323A.cpp
File metadata and controls
42 lines (39 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int main() {
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int T;
scanf("%d", &T);
while (T--) {
int n;
scanf("%d", &n);
int arr[n];
int ev = 0, od = 0;
for (int i = 0; i < n; i++) {
scanf("%d", &arr[i]);
(arr[i] & 1) ? od++ : ev++;
}
if (od > 1) {
printf("2\n");
int idx = 0, tmp = 2;
while (idx < n && tmp > 0) {
if (arr[idx] & 1) {
(tmp == 2) ? printf("%d", idx+1) : printf(" %d", idx+1);
tmp--;
}
idx++;
}
printf("\n");
}
else if (ev >= 1) {
printf("1\n");
for (int i = 0; i < n; i++) {
if (!(arr[i] & 1)) {
printf("%d\n", i+1);
break;
}
}
} else printf("-1\n");
}
}