//-->FIVAR_RoX
#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <string>
#define lli long long int
#define ld long double
//loops
#define dfloop(count1,count2,count3) for(lli i=count1;i>count2;i+=count3)
#define floop(count1,count2,count3) for(lli i=count1;i<count2;i+=count3)
#define floop1(count1,count2,count3) for(lli j=count1;j<count2;j+=count3)
#define vfloop(count1,count2,count3,i) for(lli i=count1;i<count2;i+=count3)
#define vfloop1(count1,count2,count3,i) for(i=count1;i<count2;i+=count3)
#define dvfloop(count1,count2,count3,i) for(lli i=count1;i>count2;i+=count3)
#define sloop(s,i) for(auto i=s.begin();i!=s.end();i++)
//outputs
#define qwe(x) cout<<x<<endl;
#define qw(x) cout<<x<<" ";
//for inputs
#define in(x) lli x; cin>>x;
#define ins(x) string x; cin>>x;
#define make(a,x) lli a[x]; floop(0,x,1) cin>>a[i];
#define make1(a,x,y) lli a[x][y]; floop(0,x,1) floop1(0,y,1) cin>>a[i][j];
//for pairs
#define mkp make_pair
#define fst first
#define scd second
//vectors
#define pb push_back

using namespace std;
lli sum(lli* a,lli n){
    lli s=0;
    while(n--){
        s+=a[n];    }
    return s;
}
void print_Vector(vector<lli> Vec) 
{ 
    for (lli i = 0; i < Vec.size(); i++) { 
        cout << Vec[i] << " "; 
    } 
    cout << endl; 
    return; 
} 
lli min_array(lli* a,lli n){
    lli maxi=INT_MAX;
    for (int i=0;i<n;i++){
        if (maxi>abs(a[i])) maxi=abs(a[i]);
    }
    return maxi;
}

void print_array(lli* a,lli n)
{
    for (int i=0;i<n;i++){
        cout<<a[i]<<" ";
    }
    cout<<endl;
}

void answer_fin(){
    make(a,3)
    make(b,5)
    lli pr=a[0]-b[0];
    lli pl=a[1]-b[1];
    lli k=a[2]-b[2]-max((lli)0,b[3]-pr)-max((lli)0,b[4]-pl);
    if(pr<0 || pl<0 || k<0){
        qwe("NO")
        return;
    }
    qwe("YES")
    return;
}

int main()
{
    lli test=1;
    cin>>test;
    while(test--)
    answer_fin();
}