QOJ.ac

QOJ

実行時間制限: 30.0 s メモリ制限: 256 MB 満点: 100

#17369. 名片

統計

经营一家纸张店并非易事,尤其是面对苛刻的顾客时。今天,他们带来了自己的矩形纸张,要求你将其裁剪成特定尺寸的矩形名片。此外,他们要求必须使用所有的纸张(这些纸可能不便宜,但也绝对没有那么贵!),也就是说,不能剩下任何一点碎屑。此外,将纸张裁剪成极小的碎片,然后再将它们拼接成所需尺寸的名片的“绝妙主意”遭到了嘲笑。

下图给出了一个将 $9 \times 6$ 的纸张分割成 $2 \times 3$ 名片的示例。

输入格式

输入包含多个测试用例。第一行包含测试用例的数量 $t$ ($t \le 10^5$)。接下来是 $t$ 个测试用例。每个测试用例占一行,包含四个整数 $a, b, c, d$ ($1 \le a, b, c, d \le 10^9$)。数字 $a$ 和 $b$ 是每张名片的尺寸;$c$ 和 $d$ 是纸张的尺寸。

输出格式

对于每个测试用例,如果可以将整张纸分割成名片,则输出一行 YES,否则输出 NO

样例

输入样例 1

4
2 3 9 6
2 3 8 6
2 3 6 8
2 3 5 7

输出样例 1

YES
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.