Untitled

mail@pastecode.io avatar
unknown
plain_text
21 days ago
852 B
2
Indexable
Never
#include <bits/stdc++.h>
#define endl '\n'
#define maxn 10
#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 100000000000007

using namespace std;
int l[maxn],w[maxn],h[maxn];
bool check()
{
    if(h[1] > h[3] || h[2] > h[3]) return false;
    if(min(h[1],w[1]) + min(h[2],w[2]) > max(l[3],w[3])) return false;
    if(max(h[1],w[1]) <= min(l[3],w[3]) && max(h[2],w[2]) <= min(l[3],w[3])) return true;
    return false;
}
void solve()
{
    if(check()) cout << "YES" << endl; else cout <<"NO" << endl;
}

void inp()
{
    while(cin >> l[1] >> w[1] >> h[1] >> l[2] >> w[2] >> h[2] >> l[3] >> w[3] >> h[3])
    solve();
}
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