当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2965:Business Cards

题目描述
Running a paper shop is not an easy job, especially with harsh customers. Today they brought their own rectangular sheets of paper, asking you to cut it into rectangular business cards of specific size.

Moreover, they require that all the paper (which may not be cheap, but is definitely not that expensive!) has to be used, i.e. no tiny bit may be left over.
Moreover, the brilliant idea of cutting the sheet into very small pieces, and then gluing them together in desired sheets was laughed at.

An example of a 9 *6 paper sheet divided into 2 * 3 cards is given below.

输入解释
The input contains several test cases. The first line contains the number of test cases t (t <= 10^5). Then t test cases follow. Each of them consists of one line containing four integers a, b, c, d (1 <=a, b, c, d <= 10^9).

Numbers a and b are dimensions of each business card; c and d are dimensions of the paper sheet.
输出解释
For each test case output one line containing word YES if it is possible to divide the whole sheet into business cards, and NO otherwise.
输入样例
4
2 3 9 6
2 3 8 6
2 3 6 8
2 3 5 7
输出样例
YES
YES
YES
NO
来自杭电HDUOJ的附加信息
Recommend lcy

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-2965

最后修改于 2020-10-25T22:58:43+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
10000/5000MS(Java/Others) 32768/32768K(Java/Others)