311379: CF1977A. Little Nikita

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. Little Nikitatime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

The little boy Nikita was given some cubes as a present. He decided to build a tower out of them.

Initially, the tower doesn't have any cubes. In one move, Nikita either puts exactly $1$ cube on top of the tower or removes exactly $1$ cube from the top of the tower. Is it possible that after $n$ moves, the resulting tower has exactly $m$ cubes?

Input

Each test contains multiple test cases. The first line of input contains a single integer $t$ ($1 \le t \le 100$) — the number of test cases. The description of the test cases follows.

The only line of each test case contains two integers $n$ and $m$ ($1 \le n, m \le 100$).

Output

For each test case, output "Yes" (without quotes) if Nikita can obtain a tower with $m$ cubes, and "No" (without quotes) otherwise.

You can output each letter in any case (lowercase or uppercase). For example, the strings "yEs", "yes", "Yes", and "YES" will be accepted as a positive answer.

ExampleInput
3
3 3
2 4
5 3
Output
Yes
No
Yes
Note

In the first test case, Nikita can put $1$ cube on top of the tower $3$ times in a row, so the answer is "Yes".

In the second test case, Nikita can only end up with either a tower with no blocks or a tower with $2$ blocks, so the answer is "No".

Output

题目大意:
小尼克塔得到了一些立方体作为礼物,他决定用它们搭建一个塔。
最初,塔上没有任何立方体。尼克塔每次可以将一个立方体放在塔顶,或者从塔顶拿走一个立方体。在n次操作后,塔上是否可能有正好m个立方体?

输入输出数据格式:
输入:
第一行包含一个整数t(1≤t≤100)——测试用例的数量。
接下来t行,每行包含两个整数n和m(1≤n,m≤100)。

输出:
对于每个测试用例,如果尼克塔可以得到一个有m个立方体的塔,输出“Yes”(不包含引号),否则输出“No”(不包含引号)。
每个字母的大小写都可以。例如,“yEs”、“yes”、“Yes”和“YES”都将被视为肯定答案。

示例:
输入:
3
3 3
2 4
5 3

输出:
Yes
No
Yes

注意:
在第一个测试用例中,尼克塔可以连续三次将一个立方体放在塔顶,所以答案是“Yes”。
在第二个测试用例中,尼克塔最终只能得到一个没有积木的塔或者一个有两个积木的塔,所以答案是“No”。题目大意: 小尼克塔得到了一些立方体作为礼物,他决定用它们搭建一个塔。 最初,塔上没有任何立方体。尼克塔每次可以将一个立方体放在塔顶,或者从塔顶拿走一个立方体。在n次操作后,塔上是否可能有正好m个立方体? 输入输出数据格式: 输入: 第一行包含一个整数t(1≤t≤100)——测试用例的数量。 接下来t行,每行包含两个整数n和m(1≤n,m≤100)。 输出: 对于每个测试用例,如果尼克塔可以得到一个有m个立方体的塔,输出“Yes”(不包含引号),否则输出“No”(不包含引号)。 每个字母的大小写都可以。例如,“yEs”、“yes”、“Yes”和“YES”都将被视为肯定答案。 示例: 输入: 3 3 3 2 4 5 3 输出: Yes No Yes 注意: 在第一个测试用例中,尼克塔可以连续三次将一个立方体放在塔顶,所以答案是“Yes”。 在第二个测试用例中,尼克塔最终只能得到一个没有积木的塔或者一个有两个积木的塔,所以答案是“No”。

加入题单

上一题 下一题 算法标签: