102234: [AtCoder]ABC223 E - Placing Rectangles

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

Description

Score : $500$ points

Problem Statement

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

  • Every edge is parallel to the $x$- or $y$-axis.
  • For every vertex, its $x$-coordinate is an integer between $0$ and $X$ (inclusive), and $y$-coordinate is an integer between $0$ and $Y$ (inclusive).

Determine whether it is possible to place the following three good rectangles without overlapping: a good rectangle of an area at least $A$, another of an area at least $B$, and another of an area at least $C$.

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

Constraints

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

Input

Input is given from Standard Input in the following format:

$X$ $Y$ $A$ $B$ $C$

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 $2 \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

Input

题意翻译

### 题目大意 问能否通过摆放平面中三个面积分别**至少**为 $A,B,C$ 的小矩形使得它们能被一个 $X\times Y$ 的矩形完全包含。 ### 数据范围 + $1\le X,Y \le 10^9$; + $1 \le A,B,C \le 10^{18}$。 ### 样例 1 解释 下图是三个小矩形的一种摆放方法。 ![](https://img.atcoder.jp/ghi/abc223e_sample.png) 其中 $2 \ge A$,$3\ge B$,$3 \ge C$,所以这种摆放方式是满足条件的。

Output

得分:500分

问题描述

对于正整数$X$和$Y$,在二维平面上满足以下条件的矩形被称为矩形。

  • 每条边都与$x$轴或$y$轴平行。
  • 对于每个顶点,它的$x$坐标在0和$X$(含)之间,$y$坐标在0和$Y$(含)之间。

确定是否可以在不重叠的情况下放置以下三个好矩形:一个面积至少为$A$的好矩形,另一个面积至少为$B$的好矩形,另一个面积至少为$C$的好矩形。

这里,当任何两个矩形的交集面积为0时,认为三个矩形是不重叠的。

约束条件

  • $1 \leq X, Y \leq 10^9$
  • $1 \leq A, B, C \leq 10^{18}$
  • 输入中的所有值都是整数。

输入

输入将以以下格式从标准输入给出:

$X$ $Y$ $A$ $B$ $C$

输出

如果可以在问题描述中指定的条件下放置三个矩形,则打印Yes;否则,打印No


样例输入1

3 3 2 2 3

样例输出1

Yes

下图显示了一种可能的放置方式,矩形中的数字表示其面积。

我们可以看到$2 \geq A, 3 \geq B, 3 \geq C$,满足条件。

image


样例输入2

3 3 4 4 1

样例输出2

No

在这些条件下没有可能的放置方式。


样例输入3

1000000000 1000000000 1000000000000000000 1000000000000000000 1000000000000000000

样例输出3

No

加入题单

算法标签: