問題一覧 > 通常問題

No.1850 Rewrite Product

レベル : / AI推定難易度 : 825 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 168
作問者 : 蜜蜂 / テスター : Mitarushi
お気に入りにしたユーザー ProblemId : 6756 / 自分の提出
問題文最終更新日: 2022-02-26 00:08:04
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 333 (灘高入試コンテスト2022) (順位表) の他の問題:

Problem Statement

For a variable $N$ that is a positive integer, you may perform the following operation any number of times. You may also choose not to perform it at all.

  • Declare positive integers $A,B$ satisfying $A+B=N$, and change $N$ to $A \times B$.
  • Currently, $N=X$ holds. Determine whether it is possible to make $N=Y$.

    You are given $T$ test cases; answer all of them.

    Input

    The $1$st line of the input is as follows.
    $T$
    Then, $T$ test cases follow. Each of them is given in the following format.
    $X\ \ Y$

    • $1 \leq T \leq 2 \times 10^5$
    • $1 \leq X,Y \leq 10^9$
    • All inputs are integers.

    Output

    For each test case, print Yes if it is possible to make $N=Y$, and No otherwise, followed by a newline.

    Sample

    Sample 1
    Input
    5
    6 15
    3 3
    1 10
    2022 77
    998244353 1000000000
    Output
    Yes
    Yes
    No
    Yes
    Yes

    • For the $1$st test case, you can make $N=Y$ by choosing $A=2,B=4$ in the $1$st operation and $A=5,B=3$ in the $2$nd operation.
    • For the $2$nd test case, $N=Y$ holds from the beginning.
    • For the $3$rd test case, you cannot perform any operation.

    提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。