Untitled

 avatar
user_0483151
plain_text
5 months ago
1.4 kB
1
Indexable
#include <bits/stdc++.h>
#define endl '\n'
#define maxn 1005
#define TASK bai1
#define For(i,a,b) for ( int i = a; i <= b; i++ )
#define Ford(i,a,b) for ( int i = a; i >= b; i-- )
#define MOD 10000000

using namespace std;

int a[10],b[10],c[10] ;

bool Cc() {
    if ( c[1] <= c[3] && c[2] <= c[3] ) return true;
    return false ;
}

bool Ch() {
    if ( a[1] + a[2] <= a[3] && b[1] <= b[3] && b[2] <= b[3] ) return true ;
    if ( a[1] + b[2] <= a[3] && b[1] <= b[3] && a[2] <= b[3] ) return true ;
    if ( b[1] + b[2] <= a[3] && a[1] <= b[3] && a[2] <= b[3] ) return true ;
    if ( b[1] + a[2] <= a[3] && a[1] <= b[3] && b[2] <= b[3] ) return true ;
    if ( b[1] + b[2] <= b[3] && a[1] <= a[3] && a[2] <= a[3] ) return true ;
    if ( b[1] + a[2] <= b[3] && a[1] <= a[3] && b[2] <= a[3] ) return true ;
    if ( a[1] + a[2] <= b[3] && b[1] <= a[3] && b[2] <= a[3] ) return true ;
    if ( a[2] + b[2] <= b[3] && b[1] <= a[3] && a[2] <= a[3] ) return true ;
    return false ;
}

void inp() {
    while ( cin >> a[1] >> b[1] >> c[1] >> a[2] >> b[2] >> c[2] >> a[3] >> b[3] >> c[3] ) {
        if ( Cc() + Ch() == 2 ) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
}

int main()
{
    ios_base:: sync_with_stdio(0);
    cin.tie(0);
    if(fopen("bai1.inp","r")){
        freopen("bai1.inp","r",stdin);
    }
    inp();
}
Leave a Comment