QOJ.ac

QOJ

Límite de tiempo: 1.0 s Límite de memoria: 1024 MB Puntuación total: 100 Hackeable ✓
Estadísticas

给定整数 $a, b, c$,你每次可以执行以下操作之一:

  • $a \leftarrow a + b$
  • $a \leftarrow a \oplus b$

其中 $\oplus$ 表示按位异或(XOR)操作。

你可以执行任意次数的操作,你想知道最终是否能使 $a$ 等于 $c$。

输入格式

每个输入文件包含多组测试数据。

输入的第一行包含一个整数 $T$ ($1 \le T \le 10^3$),表示测试数据的组数。

对于每组测试数据,包含一行三个整数 $a, b, c$ ($0 \le a, c \le 10^{18}$,$1 \le b \le 1000$)。

保证在单个输入文件中,$\sum b^2 \le 10^6$。

输出格式

对于每组测试数据,如果最终能使 $a$ 等于 $c$,则输出 "YES";否则输出 "NO"。

样例

输入样例 1

5
1 6 7
7 5 13
8 3 16
7 6 17
2 7 8

输出样例 1

YES
NO
YES
YES
NO

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.