#include<iostream>
#include<fstream>
#include<algorithm>
using namespace std;
int n;
int a,b;
ifstream fi("balance.inp");
ofstream fo("balance.out");
int sb1(int x)
{
int t = 0;
for ( int i = 31; i>= 0;--i)
t+=((x>>i)&1);
return t;
}
string Process(int a,int b)
{
if ( sb1(a+b)== 1 || ((a+b)%a == 0 && sb1((a+b)/a) == 1 ) )
return "YES";
return "NO";
}
int main()
{
fi>>n;
for ( int i = 0; i< n; i++)
{
fi >> a>>b;
if ( a > b)
a^=b^=a^=b;
fo << Process(a,b)<<endl;
}
return 0;
}
======================================================================================================
Cuộc đời là một dòng sông. Ai không bơi thì chết.
Name: Tien (Tory) TRAN
Email: TranTien29@gmail.com