CF1257B.Magic Stick

入门

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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 3a2\frac{3a}{2};
  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.

最近,佩蒂亚在森林中散步时发现了一根魔法棒。

由于佩蒂亚非常喜欢数字,他最先学会的是改变数字的咒语。目前,他仅掌握两种可作用于正整数的咒语:

  1. 若选定的数 aa 是偶数,则该咒语将其变为 3a2\frac{3a}{2};
  2. 若选定的数 aa 大于 1,则该咒语将其变为 a−1a-1。

注意:若一个数既是偶数又大于 1,则佩蒂亚可任选上述两种咒语之一来施放。

佩蒂亚现在手中只有一个数 xx。他想知道,能否通过施放他所掌握的咒语(可任意次、任意顺序),从 xx 得到他最喜爱的数 yy?允许不施放任何咒语,即 xx 可保持不变。

输入格式

The first line contains single integer TT (1≤T≤1041 \le T \le 10^4) — 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 \le x, y \le 10^9) — the current number and the number that Petya wants to get.

第一行包含一个整数 TT(1≤T≤1041 \le T \le 10^4)——测试用例的数量。每个测试用例由两行组成。

每个测试用例的第一行包含两个整数 xx 和 yy(1≤x,y≤1091 \le x, y \le 10^9)——当前的数字以及 Petya 想要得到的数字。

输出格式

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 NO otherwise.

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).

对于第 ii 个测试用例,请输出对应的答案——如果 Petya 能够通过已知的咒语将数字 xx 变为数字 yy,则输出 YES;否则输出 NO。

你可以以任意大小写形式输出每个字母(例如,字符串 yEs、yes、Yes 和 YES 均被视为肯定回答)。

输入输出样例

  • 输入#1

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

    输出#1

    YES
    YES
    NO
    YES
    NO
    YES
    YES

输入解题思路,AI测评打分。不知道怎么写?

首页