#include using namespace std; #define ALL(x) (x).begin(), (x).end() #define REP(i, n) for(ll i=0; i<(ll)(n); i++) template bool chmax(T& a, T b) { return a bool chmin(T& a, T b) { return a>b ? a=b, true : false; } using ll=long long; const int INF=1e9+10; const ll INFL=4e18; using VI=vector; using VVI=vector; using VL=vector; using VVL=vector; using PL=pair; using VP=vector; using WG=vector>>; #ifdef LOCAL #include "./debug.hpp" #else #define debug(...) #define print_line #endif /// @brief F_2 上の連立線形方程式 /// @ref https://mathlandscape.com/solution-sp/ /// @ref https://yukicoder.me/submissions/1011997 /// @ref verify: https://yukicoder.me/problems/no/2895 /// @brief 掃き出し法 /// @param a 連立方程式 Ax=b の拡大係数行列 /// @param col 拡大係数行列の列数 /// @param where ピボットとなる変数を記録するための配列 /// @return A のランク template int RowReduction(vector>& a, int col, vector& where) { int row=a.size(); int rank=0; for(int c=0; c int LinearEquation(vector> a, vector b, int col, vector& x0, vector>& ker) { int row=a.size(); assert(b.size()==row); vector> a2(row); for(int i=0; i where; int rank=RowReduction(a2,col+1,where); for(int r=rank; r(col,false); for(int i=0; i x(col); x[c]=true; for(int r2=0; r2>N; VL A(N); REP(i,N) cin>>A[i]; const ll L=60; const ll MX=2e5+10; vector> M(L,bitset()); REP(i,N) REP(j,L) M[j][i]=((A[i]>>j)&1); vector x0; vector> ker; vector B(L,false); bool res=LinearEquation(M,B,N,x0,ker); debug(res,ker); if(!res || ker.size()==0) { cout<<-1<>T; while(T--) solve(); }