#P10026. 「HCOI-R1」哀之变化
「HCOI-R1」哀之变化
Background
Ai likes numbers.
She also likes transformations.
Problem Description
There is an integer that starts as .
Ai wants to undergo exactly transformations. Each time, she chooses one of the following two transformations:
- ;
- .
Ai is curious whether, after exactly transformations, can become .
Input Format
This problem contains multiple test cases.
The first line contains a positive integer , representing the number of test cases.
The next lines each contain two integers, in order and , representing one query from Ai.
Output Format
Output lines. For each query, if can become , output Yes; otherwise output No.
3
2 5
2 4
3 3
No
Yes
Yes
5
4 869
48 69
8 328
66 114514
168 1919810
No
Yes
No
Yes
Yes
Hint
Sample Explanation 1
- If and , it can be proven that there is no solution.
- If and , one possible sequence of operations is:
- Step 1: ;
- Step 2: .
- If and , one possible sequence of operations is:
- Step 1: ;
- Step 2: .
- Step 3: .
Constraints
This problem uses bundled testdata.
- Subtask 0 (10 pts): , .
- Subtask 1 (25 pts): .
- Subtask 2 (65 pts): No special constraints.
For all testdata, , .
Translated by ChatGPT 5