CF1928A.Rectangle Cutting
入门
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Bob has a rectangle of size a×b. He tries to cut this rectangle into two rectangles with integer sides by making a cut parallel to one of the sides of the original rectangle. Then Bob tries to form some other rectangle from the two resulting rectangles, and he can rotate and move these two rectangles as he wishes.
Note that if two rectangles differ only by a 90∘ rotation, they are considered the same. For example, the rectangles 6×4 and 4×6 are considered the same.
Thus, from the 2×6 rectangle, another rectangle can be formed, because it can be cut into two 2×3 rectangles, and then these two rectangles can be used to form the 4×3 rectangle, which is different from the 2×6 rectangle.

However, from the 2×1 rectangle, another rectangle cannot be formed, because it can only be cut into two rectangles of 1×1, and from these, only the 1×2 and 2×1 rectangles can be formed, which are considered the same.

Help Bob determine if he can obtain some other rectangle, or if he is just wasting his time.
鲍勃有一个大小为 a×b 的矩形。他尝试沿平行于原矩形某一边的方向进行一次切割,将该矩形切成两个边长均为整数的矩形。然后,鲍勃尝试用所得的这两个矩形拼成另一个矩形;在此过程中,他可以任意旋转和移动这两个矩形。
注意:若两个矩形仅相差一个 90∘ 的旋转,则视为相同。例如,6×4 矩形与 4×6 矩形被视为同一个矩形。
因此,从 2×6 矩形出发,可以拼出另一个不同的矩形:因为它可被切成两个 2×3 矩形,而这两个矩形又可拼成 4×3 矩形,该矩形与原矩形 2×6 不同(不考虑旋转等价性)。

然而,从 2×1 矩形出发,无法拼出另一个不同的矩形:因为它只能被切成两个 1×1 的正方形,而由这两个正方形仅能拼出 1×2 或 2×1 矩形,二者在旋转意义下被视为相同。

请帮助鲍勃判断:他是否能够得到一个与原矩形(旋转等价意义下)不同的新矩形?还是他只是在白白浪费时间?
输入格式
Each test consists of multiple test cases. The first line contains a single integer t (1≤t≤104) — the number of test cases. This is followed by the description of the test cases.
The single line of each test case contains two integers a and b (1≤a,b≤109) — the size of Bob's rectangle.
每个测试包含多个测试用例。第一行包含一个整数 t(1≤t≤104),表示测试用例的数量。随后是各测试用例的描述。
每个测试用例占一行,包含两个整数 a 和 b(1≤a,b≤109),表示 Bob 的矩形的尺寸。
输出格式
For each test case, output "Yes" if Bob can obtain another rectangle from the a×b rectangle. Otherwise, output "No".
You can output the answer in any case (upper or lower). For example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as positive answers.
对于每个测试用例,如果 Bob 能够从 a×b 的矩形中得到另一个矩形,则输出 “Yes”;否则输出 “No”。
你可以以任意大小写形式输出答案(大写或小写均可)。例如,字符串 “yEs”、“yes”、“Yes” 和 “YES” 均会被识别为肯定回答。
输入输出样例
输入#1
7 1 1 2 1 2 6 3 2 2 2 2 4 6 3
输出#1
No No Yes Yes Yes Yes No
说明/提示
In the first test case, the 1×1 rectangle cannot be cut into two rectangles, so another rectangle cannot be obtained from it.
In the fourth test case, the 3×2 rectangle can be cut into two 3×1 rectangles, and from these, the 1×6 rectangle can be formed.
In the fifth test case, the 2×2 rectangle can be cut into two 1×2 rectangles, and from these, the 1×4 rectangle can be formed.
在第一个测试用例中,1×1 的矩形无法被切割成两个矩形,因此无法从中得到另一个矩形。
在第四个测试用例中,3×2 的矩形可以被切割成两个 3×1 的矩形,并由此拼成 1×6 的矩形。
在第五个测试用例中,2×2 的矩形可以被切割成两个 1×2 的矩形,并由此拼成 1×4 的矩形。
输入解题思路,AI测评打分。不知道怎么写?