题目链接
题意:
给出x,y和两种操作,问你是否能够通过不限次数的操作将x变成y,操作1:若x是偶数,乘以3/2,操作2:若x>1,x=x-1
思路:
显然x>=y时可以不断通过操作2来得到y,当x
AC代码:
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define ll long long
inline int read() {
int x = 0, f = 1;
char ch = getchar();
while (ch < '0' || ch > '9') {
if (ch == '-') f = -1;
ch = getchar();
}
while (ch >= '0' && ch <= '9') {
x = x * 10 + ch - '0';
ch = getchar();
}
return x * f;
}
ll min(ll x, ll y) {return x < y ? x : y;}
const int maxn = 2e5 + 1;
const ll INF=0x3f3f3f;
const int mod = 1e9 + 7;
ll n,arr[maxn],brr[maxn];
int main() {
int t;
cin>>t;
while(t--){
ll a,b;
cin>>a>>b;
if(a>=b){
cout<<"YES"<<endl;
}
else{
if(a==1||a==3){
cout<<"NO"<<endl;
}
else if(a==2){
if(b==3) cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
else cout<<"YES"<<endl;
}
}
return 0;
}