B. Gerald is into Art

Time Limit: 20 Sec

Memory Limit: 256 MB

题目连接

http://codeforces.com/problemset/problem/560/B

Description

Gerald bought two very rare paintings at the Sotheby's auction and he now wants to hang them on the wall. For that he bought a special board to attach it to the wall and place the paintings on the board. The board has shape of an a1 × b1 rectangle, the paintings have shape of a a2 × b2 and a3 × b3 rectangles.

Since the paintings are painted in the style of abstract art, it does not matter exactly how they will be rotated, but still, one side of both the board, and each of the paintings must be parallel to the floor. The paintings can touch each other and the edges of the board, but can not overlap or go beyond the edge of the board. Gerald asks whether it is possible to place the paintings on the board, or is the board he bought not large enough?

intput

The first line contains two space-separated numbers a1 and b1 — the sides of the board. Next two lines contain numbers a2, b2, a3 andb3 — the sides of the paintings. All numbers ai, bi in the input are integers and fit into the range from 1 to 1000.

Output

If the paintings can be placed on the wall, print "YES" (without the quotes), and if they cannot, print "NO" (without the quotes).

Sample Input

4 2
2 3
1 2

Sample Output

YES

HINT

题意

是否能将下面两个矩形放入第一个矩形

题解:

无脑

代码

#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <string>
#include <stack>
#include <math.h>
#include <vector>
#include <string.h>
using namespace std; typedef __int64 ll;
const int INF = (int)1E9+;
inline ll read()
{
ll x=,f=;
char ch=getchar();
while(ch<''||ch>'')
{
if(ch=='-')f=-;
ch=getchar();
}
while(ch>=''&&ch<='')
{
x=x*+ch-'';
ch=getchar();
}
return x*f;
} //******************************* int main()
{
int a1,a2,a3,b1,b2,b3;
int a,b;
scanf("%d%d",&a,&b);
scanf("%d%d",&a2,&b2);
scanf("%d%d",&a3,&b3); if((max(a2,b3)<=a&&(b2+a3)<=b)||
(max(a2,b3)<=b&&(b2+a3)<=a)||
(max(b2,b3)<=b&&(a3+a2)<=a)||
(max(b2,b3)<=a&&(a3+a2)<=b)||
(max(a2,a3)<=a&&(b2+b3)<=b)||
(max(a2,a3)<=b&&(b2+b3)<=a)||
(max(b2,a3)<=a&&(b3+a2)<=b)||
(max(b2,a3)<=b&&(b3+a2)<=a))
{
printf("YES\n");
}
else printf("NO\n");
return ;
}

Codeforces Round #313 (Div. 2)B.B. Gerald is into Art的更多相关文章

  1. Codeforces Round #313 (Div. 2) C. Gerald's Hexagon 数学

    C. Gerald's Hexagon Time Limit: 2 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/559/pr ...

  2. Codeforces Round #313 (Div. 1) A. Gerald's Hexagon 数学题

    A. Gerald's Hexagon Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/559/p ...

  3. Codeforces Round #313 (Div. 2) B. Gerald is into Art 水题

    B. Gerald is into Art Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/560 ...

  4. Codeforces Round #313 (Div. 1) C. Gerald and Giant Chess DP

    C. Gerald and Giant Chess Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest ...

  5. 【打CF,学算法——二星级】Codeforces Round #313 (Div. 2) B. Gerald is into Art(水题)

    [CF简单介绍] 提交链接:http://codeforces.com/contest/560/problem/B 题面: B. Gerald is into Art time limit per t ...

  6. Codeforces Round #313 (Div. 2) A B C 思路 枚举 数学

    A. Currency System in Geraldion time limit per test 2 seconds memory limit per test 256 megabytes in ...

  7. Codeforces Round #313 (Div. 2)(A,B,C,D)

    A题: 题目地址:Currency System in Geraldion 题意:给出n中货币的面值(每种货币有无数张),要求不能表示出的货币的最小值.若全部面值的都能表示,输出-1. 思路:水题,就 ...

  8. Codeforces Round #313 (Div. 2) 解题报告

    A. Currency System in Geraldion: 题意:有n中不同面额的纸币,问用这些纸币所不能加和到的值的最小值. 思路:显然假设这些纸币的最小钱为1的话,它就能够组成随意面额. 假 ...

  9. dp - Codeforces Round #313 (Div. 1) C. Gerald and Giant Chess

    Gerald and Giant Chess Problem's Link: http://codeforces.com/contest/559/problem/C Mean: 一个n*m的网格,让你 ...

随机推荐

  1. Centos上传下载小工具lrzsz

    http://www.centoscn.com/image-text/install/2013/0819/1374.html

  2. 我的电脑右下角的日期也不见了只剩下时间,Win7系统,请问是什么原因啊?

    A:今天是2013/10/10,日期变为八位,宽度就不够了,把任务栏拉宽就好了 Q:win7 任务栏时间区可以拉宽吗?使之显示日期等 A:你的任务栏锁定了的,右键单击任务栏-锁定任务栏前面的勾去掉,鼠 ...

  3. 【原创】angularjs1.3.0源码解析之service

    Angular服务 在angular中,服务(service)是以提供特定的功能的形式而存在的. angular本身提供了很多内置服务,比如: $q: 提供了对promise的支持. $http: 提 ...

  4. 利用ADSL拨号上网方式如何搭建服务器

    序:搭建服务器需要两个条件硬件服务器和固定公网IP,随便一台个人电脑都可以作为硬件服务器,就剩下一个问题,如何获得一个固定公网IP. 第一章 扫盲:ADSL拨号上网方式,本地IP与公网IP的区别 一. ...

  5. bc.34.B.Building Blocks(贪心)

    Building Blocks Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) ...

  6. cocos2dx新研发的游戏,手机运行时非常热的解决方案

    cocos2dx新研发的游戏,手机运行时非常热,有需要的朋友可以参考下. cocos2dx新研发的游戏,手机上运行时导致手机非常热,后来听其他项目组分享时得知,可以通过降帧解决这个问题,原来是coco ...

  7. [转]linux awk命令详解

    原文链接 : http://blog.chinaunix.net/uid-23302288-id-3785105.html   awk是行处理器: 相比较屏幕处理的优点,在处理庞大文件时不会出现内存溢 ...

  8. table表头标题th浮动提示-MyTable.js

    /* $(document).ready(function () { var maxH = ($(window).height() - $("#divParent").positi ...

  9. django-cms 代码研究(六)plugin的深入分析

    示例代码: https://github.com/divio/djangocms-picture 以上一个图片的插件,安装后可在页面中添加图片,效果如下图: 以此为切入点,分析plugin的逻辑: 分 ...

  10. python的类变量与实例变量

    python的类内部定义的变量 ,形式上没有区分实例变量和类变量(java的静态变量),测试结果如下: