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. 每日构建【Daily Build Using CruiseControl.NET and MSBuild】(转载)

    在上一篇项目 管理实践教程二.源代码控制[Source Control Using VisualSVN Server and TortoiseSVN]中 我们已经讲解了如何使用TortoiseSVN和 ...

  2. dao、domain、service、web、vo、Model这些层的功能是什么

    这些层次都是用来管理不同的代码,让代码具有更好的维护性.开发中一般采用三层架构即MVC的模式来进行开发,M:代表model,可以理解为javaBean:V:代表view,可以理解为jsp:c:代表co ...

  3. Android-调用优酷SDK上传视频

    最近在研究用优酷的SDK来进行视频上传的功能,由于优酷的SDK只是提供了一个上传的sample code,没有涉及到授权的过程,对于新手来说,可能非常棘手,现在分享一下我的思路:   程序实现前我们先 ...

  4. ls -alrth 及ls 详解

    idcdpi  抓包过程中 用了命令  ls   - alrth :命令,所以回头重新学习 ls命令 linux ls和 ll 命令 标签: linuxsocketssolarisbash出版扩展 2 ...

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

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

  6. 读<你必须知道的.NET>IL指令笔记

    IL指令笔记: 1.newObj和initObj MSDN解释:newObj用于分配和初始化对象,而initObj用户初始化值类型 newObj解释: (1):从托管堆分配指定类型所需要的全部内存空间 ...

  7. 繁华模拟赛 Vicent坐电梯

    /*n<=5000­这样就不能用O(n)的转移了,而是要用O(1)的转移.­注意我们每次的转移都来自一个连续的区间,而且我们是求和­区间求和?­前缀和!­令sum[step][i]表示f[ste ...

  8. 畅通工程再续(MST)

    畅通工程再续 Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Statu ...

  9. 淘宝(阿里百川)手机客户端开发日记第四篇 自定义ListView详解

    我们知道,如果采用官方的ListView,实现的功能在很多时候,并不能满足自己的业务需求,比如在设计到复杂的列表的时候,这一节,我们就开始动手自己实现自定义的ListView. 在上一节中,我们采用了 ...

  10. ubuntu 快速安装jre

    sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java7-i ...