luogu#P7066. [NWRRC2014] Grave
[NWRRC2014] Grave
题目描述
Gerard develops a Halloween computer game. The game is played on a rectangular graveyard with a rectangular chapel in it. During the game, the player places new rectangular graves on the graveyard. The grave should completely fit inside graveyard territory and should not overlap with the chapel. The grave may touch borders of the graveyard or the chapel.
Gerard asked you to write a program that determines whether it is possible to place a new grave of given size or there is no enough space for it.
输入格式
The first line of the input file contains two pairs of integers: $x_{1}, y_{1}, x_{2}, y_{2} (−10^{9} \le x_{1} < x_{2} \le 10^{9}; −10^{9} \le y_{1} < y_{2} \le 10^{9})$ — coordinates of bottom left and top right corners of the graveyard. The second line also contains two pairs of integers $x_{3}, y_{3}, x_{4}, y_{4} (x_{1} < x_{3} < x_{4} < x_{2}; y_{1} < y_{3} < y_{4} < y_{2})$ — coordinates of bottom left and top right corners of the chapel.
The third line contains two integers — width and height of the new grave Side with length should be placed along OX axis, side with length — along OY axis.
输出格式
The only line of the output file should contain single word: Yes
, if it is possible to place the new grave, or No
, if there is not enough space for it.
题目大意
在一块长方形的墓地上,有一个长方形的教堂,现在给出一个长宽已知的墓碑,墓碑不能与教堂重叠,询问这块墓地上能否放下这块墓碑。
输入第一行两对坐标,代表墓地左下角和右上角的坐标(先 轴再 轴);
第二行也是两对坐标,代表教堂左下角和右上角的坐标(先 轴再 轴)(保证教堂完全在墓地内部且边缘不重叠);
第三行两个整数 和 ,代表墓碑的长与宽,要求长度为 的一侧必须对应 轴,长度为 的一侧必须对应 轴。
输出一行一个字符串,如果放得下,输出 Yes
,否则输出 No
。
1 1 11 8
2 3 8 6
3 2
Yes
1 1 11 8
2 3 8 6
4 3
No
提示
Time limit: 2 s, Memory limit: 256 MB.