#include <bits/stdc++.h>
using namespace std;
int main()
{
int t,a,b;
cin>>t;
while(t--){
cin>>a>>b;
if(a=='1'&&b=='1') cout<<0;
if(a==b){
if(a%2==0&&a!=2){
if(a/2==4) cout<<2;
else cout<<1;
}else{
if(a%2==1&&a!=9) cout<<0;
else{
if(a/2==1) cout<<0;
else cout<<1;
}
}
}else cout<<111;
cout<<endl;
}
}
全部评论
(1) 回帖