#abc223e. E - Placing Rectangles

E - Placing Rectangles

Score : 500500 points

问题描述

对于正整数 XXYY,在二维平面上满足以下条件的矩形被称为 好矩形

  • 每条边都与 xx 轴或 yy 轴平行。
  • 对于每个顶点,其 xx 坐标是介于 00XX(包括两端点)之间的整数,而 yy 坐标是介于 00YY(包括两端点)之间的整数。

判断是否可以在不重叠的情况下放置以下三个好矩形:一个面积至少为 AA 的好矩形、另一个面积至少为 BB 的好矩形,以及另一个面积至少为 CC 的好矩形。

这里,当任意两个矩形的交集面积为 00 时,我们认为这三个矩形是非重叠的。

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

For positive integers XX and YY, a rectangle in a two-dimensional plane that satisfies the conditions below is said to be good.

  • Every edge is parallel to the xx- or yy-axis.
  • For every vertex, its xx-coordinate is an integer between 00 and XX (inclusive), and yy-coordinate is an integer between 00 and YY (inclusive).

Determine whether it is possible to place the following three good rectangles without overlapping: a good rectangle of an area at least AA, another of an area at least BB, and another of an area at least CC.

Here, three rectangles are considered to be non-overlapping when the intersection of any two of them has an area of 00.

Constraints

  • 1X,Y1091 \leq X, Y \leq 10^9
  • 1A,B,C10181 \leq A, B, C \leq 10^{18}
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

XX YY AA BB CC

Output

If it is possible to place three rectangles under the conditions specified in the Problem Statement, print Yes; otherwise, print No.

Sample Input 1

3 3 2 2 3

Sample Output 1

Yes

The figure below shows a possible placement, where the number in a rectangle represents its area.

We can see that 2A,3B,3C2 \geq A, 3 \geq B, 3 \geq C, satisfying the conditions.

image

Sample Input 2

3 3 4 4 1

Sample Output 2

No

There is no possible placement under the conditions.

Sample Input 3

1000000000 1000000000 1000000000000000000 1000000000000000000 1000000000000000000

Sample Output 3

No

update @ 2024/3/10 09:49:42

}