아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Multiplication and Division by 2

시간 제한2초메모리 제한512 MB

요약
2^32을 법으로 하는 2의 곱셈과 내림 나눗셈을 반복해 x를 y로 만들 수 있는지 판정한다.
난이도

보통10점 중 5점

유형
비트 연산, 수학, 정수론
정답자
아직 제출이 없습니다

문제

Consider the number xx stored in uint32 data type. We can multiply or divide it by 22 any number of times in any order. Can we obtain the number yy after some sequence of operations?

When aa is stored in an uint32, and we multiply it by 22, it transforms into (a⋅2) mod 232(a \cdot 2) \bmod 2^{32}. For example, (3⋅2) mod 232=6(3 \cdot 2) \bmod 2^{32} = 6, and (2,147,483,649⋅2) mod 232=2(2\\,147\\,483\\,649 \cdot 2) \bmod 2^{32} = 2.

When aa is stored in an uint32, and we divide it by 22, it transforms into ⌊a2⌋\left\lfloor\frac{a}{2}\right\rfloor. For example, ⌊62⌋=3\left\lfloor\frac{6}{2}\right\rfloor = 3, and ⌊32⌋=1\left\lfloor\frac{3}{2}\right\rfloor = 1.

입력

The first line contains an integer tt, the number of test cases (1≤t≤10001 \le t \le 1000). The next tt lines describe test cases, one per line. Each test case is given by two integers xx and yy (0≤x,y<2320 \le x, y < 2^{32}).

출력

For each test case, print a single word on a separate line: "Yes" if we can turn xx into yy using the allowed operations, or "No" otherwise.

힌트

In the first test case, we can multiply xx by 22, and then divide the result by 22 to get yy.

In the second test case, there is no way to turn xx into yy.

예제1

  1. 예제 1

    입력
    2
    2147483649 1
    9 13
    
    예상 출력
    Yes
    No