Problem G. Grave

题目连接:

http://codeforces.com/gym/100531/attachments

Description

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.

Input

The first line of the input file contains two pairs of integers: x1, y1, x2, y2 (−109 ≤ x1 < x2 ≤ 109

;

−109 ≤ y1 < y2 ≤ 109

) — coordinates of bottom left and top right corners of the graveyard. The second

line also contains two pairs of integers x3, y3, x4, y4 (x1 < x3 < x4 < x2; y1 < y3 < y4 < y2) —

coordinates of bottom left and top right corners of the chapel.

The third line contains two integers w, h — width and height of the new grave (1 ≤ w, h ≤ 109

). Side

with length w should be placed along OX axis, side with length h — along OY axis

Output

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.

Sample Input

1 1 11 8

2 3 8 6

3 2

Sample Output

Yes

Hint

题意

有一个矩形,然后在里面放一个矩阵,问你还能不能再放进去一个w*h的矩阵进去

题解:

水题,只有四个空位子,把这四个位置都判断一下就好

代码

#include<bits/stdc++.h>
using namespace std; int x1,y1,x2,y2;
int x3,y3,x4,y4;
int w,h;
int main()
{
freopen("grave.in","r",stdin);
freopen("grave.out","w",stdout);
cin>>x1>>y1>>x2>>y2;
cin>>x3>>y3>>x4>>y4;
cin>>w>>h;
int l = x2 - x1;
int H = y2 - y1;
if(l>=w&&y3-y1>=h)
return puts("Yes");
if(l>=w&&y2-y4>=h)
return puts("Yes");
if(H>=h&&x3-x1>=w)
return puts("Yes");
if(H>=h&&x2-x4>=w)
return puts("Yes");
return puts("No");
}

Codeforces Gym 100531G Grave 水题的更多相关文章

  1. Gym 100531G Grave(水题)

    题意:给定一个大矩形,再给定在一个小矩形,然后给定一个新矩形的长和高,问你能不能把这个新矩形放到大矩形里,并且不与小矩形相交. 析:直接判定小矩形的上下左右四个方向,能不能即可. 代码如下: #pra ...

  2. Codeforces Gym 100286I iSharp 水题

    Problem I. iSharpTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/ ...

  3. CodeForces Gym 100685C Cinderella (水题)

    题意:给定 n 个杯子,里面有不同体积的水,然后问你要把所有的杯子的水的体积都一样,至少要倒少多少个杯子. 析:既然最后都一样,那么先求平均数然后再数一下,哪个杯子的开始的体积就大于平均数,这是一定要 ...

  4. codeforces 706A A. Beru-taxi(水题)

    题目链接: A. Beru-taxi 题意: 问那个taxi到他的时间最短,水题; AC代码: #include <iostream> #include <cstdio> #i ...

  5. codeforces 569B B. Inventory(水题)

    题目链接: B. Inventory time limit per test 1 second memory limit per test 256 megabytes input standard i ...

  6. Codeforces 489A SwapSort (水题)

    A. SwapSort time limit per test 1 second memory limit per test 256 megabytes input standard input ou ...

  7. UVaLive 6591 && Gym 100299L Bus (水题)

    题意:略. 析:不解释,水题. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include < ...

  8. codeforces 688A A. Opponents(水题)

    题目链接: A. Opponents time limit per test 1 second memory limit per test 256 megabytes input standard i ...

  9. CodeForces 534B Covered Path (水题)

    题意:给定两个速度,一个一初速度,一个末速度,然后给定 t 秒时间,还每秒速度最多变化多少,让你求最长距离. 析:其实这个题很水的,看一遍就知道怎么做了,很明显就是先从末速度开始算起,然后倒着推. 代 ...

随机推荐

  1. 继承View绘制正方形且360旋转

    import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; impor ...

  2. Loadrunner中与事务相关的概念及函数

    一.事务 事务是指用户在客户端做一种或多种业务所需要的操作集,通过事务函数可以标记完成该业务所需要的操作内容:另一方面可以用来统计用户操作的相应时间.事务响应时间是指通过记录用户请求的开始时间和服务器 ...

  3. 建立连接ALM的xml config文件

    我就不贴所有的了,如果有谁想要所有源码和应用程序,可以密我 这里我贴下如何在第一次运行的时候自动建立一个ALMConfig的xml文件 private static void CreateALMCon ...

  4. 写在阿里去IOE一周年

    [文/ 任英杰] 去年5月17日,阿里巴巴支付宝最后一台IBM小型机在下线,标志着阿里完成去IOE.随后一场去IOE运动不断发酵,甚至传闻IBM中国去年损失了20%的合同额. 去了IOE,奔向何方?阿 ...

  5. DouNet学习_收发邮件

    一.收发邮件 --->第一步:发邮件首先要有发送者的邮箱地址和登录的密码才能发送 这些都写在APP里  不要写死 --->第二步:发邮件就要有网络,要添加net.Mail命名空间 要发送的 ...

  6. sql统计重复数据

    sql代码如下: 统计重复的数据 select MingCheng from tabShouFeiGongShi group by MingCheng having count(MingCheng) ...

  7. CentOS6.5修改mysql数据文件路径

    1.停止mysql服务      service mysql stop 2.移动数据文件位置(保留原文件权限)      cp -a /var/lib/mysql /mysqldata 3.修改/et ...

  8. EventSource (node.js 与 OC)

    node.js服务器代码: var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, ...

  9. DCPcrypt

    delphi dcp component TDCP_md5 md5 String; md5 stream;流文件 procedure TForm1.Button1Click(Sender: TObje ...

  10. centos下apache安装后无法访问

    2013.11.28遇到的问题: -------------------------------------- 一.centos下apache安装后无法访问 得查一下防火墙的问题 iptables添加 ...