#include<bits/stdc++.h> using namespace std; #define f(n,m,i) for(int i(n);i<=m;++i) #define nf(n,m,i) for(int i(n);i>=m;--i) #define dbug(x) cerr<<#x<<':'<<x<<' '; #define ent cerr<<'\n'; #define ll long long #define gc getchar_unlocked() #define pc putchar_unlocked inline const ll ip(){ ll g(0);char c(gc);bool ne(0); for(;c<'0'||c>'9';c=gc) if(c=='-') ne^=1; for(;c>='0'&&c<='9';c=gc) g=g*10+(c^48); return ne?-g:g; } const void op(ll x){ if(x<0) pc('-'),x=-x; if(x>9) op(x/10); pc(x%10^48); } inline const ll min(const ll &a,const ll &b){ return a<b?a:b;} inline const ll max(const ll &a,const ll &b){ return a<b?b:a;} int t,a,b,c,cnta,cntb,sa,sb,s[105],tp; int main(){ //freopen("xor.in","r",stdin),freopen("xor.out","w",stdout); t=ip(); while(t--){ a=ip(),b=ip(),c=ip(),cnta=cntb=tp=0,sa=a,sb=b; if(!a&&!b&&c){ op(-1),pc('\n');continue;} if(a==b&&b==c){ op(0),pc('\n'),pc('\n');continue;} while(sa) sa>>=1,++cnta; while(sb) sb>>=1,++cntb; if(cnta>cntb) s[++tp]=4,b^=a,cntb=cnta; if(cnta<cntb) s[++tp]=3,a^=b,cnta=cntb; nf(31,cnta+1,i){ if(((a>>cnta-1)^(c>>i-1))&1) s[++tp]=3,a^=b; s[++tp]=1,a<<=1; } nf(cnta,1,i){ if(((a>>i-1)^(c>>i-1))&1) s[++tp]=3,a^=b; s[++tp]=2,b>>=1; } s[++tp]=4,b^=a; op(tp),pc('\n'); f(1,tp,i) op(s[i]),pc(' '); pc('\n'); } return 0; } /* g++ -O2 xor.cpp -o code ./code 5 3 5 6 0 0 1 7 7 7 2 9 4 12386 21473 11256 */ 111秘 我要bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb<-这啥? 🕐🕐🕐🌾<-这啥? 安雨姐姐!<-这啥? https://www.arealme.com/depression-test/cn/ 111㊙ ①Ⅰ一㊙ 妈妈 https://readme-typing-svg.demolab.com/?font=Fira+Code&weight=650&size=32&pause=0&color=510555&width=600&lines=sto+ImposterAnYu+orz qwq anyu姐姐好嘶嘶!<-qaq
Note.ms
/ImposterAnYu1