Recently Petya walked in the forest and found a magic stick.

Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:

  1. If the chosen number aa is even, then the spell will turn it into 3a23a2;
  2. If the chosen number aa is greater than one, then the spell will turn it into a−1a−1.

Note that if the number is even and greater than one, then Petya can choose which spell to apply.

Petya now has only one number xx. He wants to know if his favorite number yy can be obtained from xx using the spells he knows. The spells can be used any number of times in any order. It is not required to use spells, Petya can leave xx as it is.

Input

The first line contains single integer TT (1≤T≤1041≤T≤104) — the number of test cases. Each test case consists of two lines.

The first line of each test case contains two integers xx and yy (1≤x,y≤1091≤x,y≤109) — the current number and the number that Petya wants to get.

Output

For the ii-th test case print the answer on it — YES if Petya can get the number yy from the number xx using known spells, and NOotherwise.

You may print every letter in any case you want (so, for example, the strings yEs, yes, Yes and YES will all be recognized as positive answer).

Example
input

Copy
7
2 3
1 1
3 6
6 8
1 2
4 1
31235 6578234
output

Copy
YES
YES
NO
YES
NO
YES
YES
#include<bits/stdc++.h>
using namespace std ;
int main() {
ios_base::sync_with_stdio(false);
cin.tie();
cin >> T;
while(T--) {
cin >> X >> Y;
if (X >= ) {//当x>=4 所有都能到
cout << "YES\n";
} else if (X == && Y <= ) {
cout << "YES\n";
} else if (X == && Y <= ) {
cout << "YES\n";
} else if (X == && Y <= ) {
cout << "YES\n";
} else cout << "NO\n";
}
return ;
}

Educational Codeforces Round 76 (Rated for Div. 2) B. Magic Stick的更多相关文章

  1. Educational Codeforces Round 76 (Rated for Div. 2) B. Magic Stick 水题

    B. Magic Stick Recently Petya walked in the forest and found a magic stick. Since Petya really likes ...

  2. Educational Codeforces Round 76 (Rated for Div. 2) E. The Contest

    Educational Codeforces Round 76 (Rated for Div. 2) E. The Contest(dp+线段树) 题目链接 题意: 给定3个人互不相同的多个数字,可以 ...

  3. Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship

    Problem   Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship Time Limit: 2000 mSec P ...

  4. Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems(动态规划+矩阵快速幂)

    Problem   Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems Time Limit: 3000 mSec P ...

  5. Educational Codeforces Round 76 (Rated for Div. 2)E(dp||贪心||题解写法)

    题:https://codeforces.com/contest/1257/problem/E 题意:给定3个数组,可行操作:每个数都可以跳到另外俩个数组中去,实行多步操作后使三个数组拼接起来形成升序 ...

  6. Educational Codeforces Round 76 (Rated for Div. 2)

    传送门 A. Two Rival Students 签到. Code /* * Author: heyuhhh * Created Time: 2019/11/13 22:37:26 */ #incl ...

  7. Educational Codeforces Round 76 (Rated for Div. 2) E. The Contest dp

    E. The Contest A team of three programmers is going to play a contest. The contest consists of

  8. Educational Codeforces Round 76 (Rated for Div. 2) D. Yet Another Monster Killing Problem 贪心

    D. Yet Another Monster Killing Problem You play a computer game. In this game, you lead a party of

  9. Educational Codeforces Round 76 (Rated for Div. 2) C. Dominated Subarray 水题

    C. Dominated Subarray Let's call an array

随机推荐

  1. linux 配置compoer

    配置默认php 删除 rm -f /usr/bin/php 改到php7.3版本的composer /bin/php /usr/bin/php 多版本支持 配置php7专用composer70 cd ...

  2. Android Studio阶段性学习总结_1

    这半个月一直在学习Android方面的知识,对Android开发有了一个基本的认识,学会了Android studio的基本操作. 在建立第一个Android studio项目时,我遇到了很大的阻碍, ...

  3. H3C链路聚合

    以太网链路聚合通过将多条以太网物理链路捆绑在一起形成一条以太网逻辑链路,实现增加链路带宽的目的,同时这些捆绑在一起的链路通过相互动态备份,可以有效地提高链路的可靠性. 一.基本概念 1.聚合接口/聚合 ...

  4. cdn第三方前端依赖架包共享地址

    https://cdnjs.com/ 可在此网站查找你需要的稳定第三方前端依赖架包

  5. [ZJOI2007] 矩阵游戏 - 二分图匹配

    题意:问一个\(0-1\)方阵是不是非奇异的 其实我真的很想求行列式 #include <bits/stdc++.h> using namespace std; #define N 505 ...

  6. 从ASCII到Unicode再到UTF-8的历史原由

    编码 大小 支持语言 ASCII 1个字节 英文 Unicode 2个字节(生僻字4个) 所有语言 UTF-8 1-6个字节,英文字母1个字节,汉字3个字节,生僻字4-6个字节 所有语言 具体解释: ...

  7. sql 分组后查询出排序字段

    select  row_number() over(partition by  CODE order by SEQUENCE) as RowIndex  from Table 注:根据表的CODE 字 ...

  8. Python开发坦克大战

    Python不仅能开发网站,爬虫数据分析等,他其实也可以写游戏,接下来就给大家分享下坦克大战的代码: PS:很多人在学习Python的过程中,往往因为遇问题解决不了或者没好的教程从而导致自己放弃,为此 ...

  9. 巨杉TechDay回顾 | WARNING!您参加的数据库沙龙热度已爆表……

    自从2008年“大数据”这一概念被首次提出以来,在过去这10年中,几乎各行各业都或多或少受到了这一概念的影响.与此同时,在AI.云计算.物联网.区块链等新兴技术快速发展的今天,数据库己经成为了决定所有 ...

  10. linq和隐式类型var

    隐式类型 var 强类型,声明的时候必须给变量赋值,编译器会根据值来确定其类型.只能出现在局部变量或脚本代码中. 使用范围: 简单类型:如int string等 复杂类型:如数组.类等 逻辑语句:fo ...