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

int main(){
	
	int t;
	cin>>t;
	
	while(t--){
		
		ll P, H;
		int n;
		cin>>P>>H>>n;
		
		vector<ll> p(n);
		vector<ll> h(n);	
		
		for(int i = 0; i<n; i++){
			cin>>p[i];
		}
		for(int i = 0; i<n; i++){
			cin>>h[i];
		}
		
		ll maxi = 0;
		
		for(int i = 0; i<n; i++){
			
			ll x = h[i]/P;
			if(h[i]%P==0){
				x--;
			}
			H = H - p[i]*x;
			if(p[i] > maxi){
				H = H - maxi;
				maxi = p[i];
			}
			else{
				H = H - p[i];
			}
			
			if(H<0){
				H = 0;
			}
		}
		
		if(H>0){
			cout<<"YES\n";
		}
		else{
			cout<<"NO\n";
		}
		
	}
	
	return 0;
}
