#include <bits/stdc++.h>
using namespace std;

int main() {
	int t;
	cin>>t;
	for(int i=1;i<=t;i++)
	{
	    
	    int c1,c2,c3,flag1=0,flag2=0;
	    int a1,a2,a3,a4,a5;
	    cin>>c1>>c2>>c3;
	    cin>>a1>>a2>>a3>>a4>>a5;
	    if(a1>c1||a2>c2||a3>c3)
	    {
	        cout<<"NO"<<"\n";
	        //continue;
	    }
	    else
	    {
	        c1=c1-a1;c2=c2-a2;c3=c3-a3;
	        //c1=min(c1,a4);
	       a4=a4-min(a4,c1);
	       a5=a5-min(a5,c2);
	       
	       if(a4+a5>c3)
	       cout<<"NO"<<"\n";
	       else
	       cout<<"YES"<<"\n";
	        
	    }
	    
	}
	return 0;
}
