#include<iostream> #include<cstdio> #include<algorithm> using namespace std; int t,n,ans,tot,cnt,a[30],sg[30],mex[30000]; int main(){ scanf("%d",&t); while (t--){ scanf("%d",&n); for (int i=1;i<=n;i++) scanf("%d",&a[i]); sg[n]=0; for (int i=n-1;i>=1;i--){ cnt++; for (int j=i+1;j<=n;j++) for (int k=j;k<=n;k++) mex[sg[j]^sg[k]]=cnt; for (int j=0;mex[j]==cnt;j++) sg[i]=j+1; } ans=0; for (int i=1;i<=n;i++) if (a[i]&1) ans^=sg[i]; tot=0; for (int i=1;i<=n;i++) if (a[i]) for (int j=i+1;j<=n;j++) for (int k=j;k<=n;k++){ if (ans^sg[i]^sg[j]^sg[k]) continue; if (++tot==1) printf("%d %d %d\n",i-1,j-1,k-1); } if (!tot) puts("-1 -1 -1"); printf("%d\n",tot); } return 0; }
|