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. yarn 不要一起用 npm

    yarn 不要一起用 npm 如果一起用,看下lock 的版本一样不,不一样可能会出现问题

  2. PIE-SDK For C++栅格数据集的读写

    1.功能简介 栅格数据包含很多信息,在数据的运用中需要对数据的信息进行读取或写入,目前PIE SDK支持多种数据格式的数据读取和写入,下面对栅格数据格式的数据读写功能进行介绍. 2.功能实现说明 2. ...

  3. 配置hosts快速访问GitHub

    经常要clone github中的一些项目,无奈如果不爬梯子的话速度实在是龟速,经常1k/s,于是搜了下解决方法,改HOSTS大法.Windows下在C:/Windows/system32/drive ...

  4. Vuex项目实战store

    首先简单了解一下什么是Vuex? Vuex是一个专为Vue.js应用程序开发的状态管理模式.采用集中式存储来管理应用所有组件的状态. 以下是对vuex的使用的简单介绍: 一.安装 npm i vuex ...

  5. 使用Java代码将一张图片生成为字符画

    测试的图片: 输出的结果: 代码: package test; import java.awt.image.BufferedImage; import java.io.File; import jav ...

  6. 如何架构一个 React 项目?

    编程有点像搞园艺.比起竭力去对付BUG(虫子),我们更愿意把一切弄得整洁有序,以免最后落得个身在荒野丛林中.低劣的架构会拖我们的后腿,也会使得BUG更容易钻进系统里去. 想要对你的项目进行架构,方法有 ...

  7. jquery tagsinput监听输入、修改、删除事件

    个人博客 地址:http://www.wenhaofan.com/article/20181118192458 由于度娘上的根本搜不到对应的操作,连该插件对应的文档介绍都没有,不得已debug了源码才 ...

  8. gogs迁移至gitlab

    一.先来聊一聊迁移的思路,不管是gogs迁移至gitlab,还是gitlab迁移至gogs,亦或gitlab迁移至gitlab,手动迁移的步骤都是如下图所示(在gitlab上新建一个空项目就会有这样的 ...

  9. 巨杉Tech | 使用 SequoiaDB + Docker + Nodejs 搭建 Web 服务器

    容器化技术的出现大大简化了应用开发人员在构建底层基础设施的工作.SequoiaDB 巨杉数据库于3.2.1版本正式推出了 Docker 容器化部署方案,本文将会基于 SequoiaDB 巨杉数据库与N ...

  10. 己亥清爽恢复系列之数据文件1篇:SYSTEM物理损坏或丢失(关键表空间)

    己亥清爽系列说明:清爽系列是作为恢复系列的基础篇,基于FS(File System)文件系统的手工还原恢复,也叫基于用户管理的还原恢复.来自于博客园AskScuti 实验说明:在有完全备份基础下,物理 ...