#include<bits/stdc++.h>
using namespace std;
#define int long long 
#define F first
#define S second
void test(){
	int power, health, n; cin >> power >> health >> n;
	vector<int> a(n), b(n);
	for(int &i:a)
		cin >> i;
	for(int &i:b)
		cin >> i;
	vector<pair<int,int>> c(n);
	for(int i = 0; i < n; i++){
		c[i] = {a[i],b[i]};
	}
	sort(c.begin(), c.end());
	//reverse(c.begin(), c.end());
	for(int i = 0; i < n; i++){
		int duel = c[i].S / power;
		if(c[i].S % power)
			duel++;
		int z = health / c[i].F;
		if(health % c[i].F)
			++z;
		if(z < duel){
			cout << "NO\n";
			return;
		}
		health -= c[i].F * duel;
		if(i != n - 1 && health <= 0){
			cout << "NO\n";
			return;
		}
	}
	cout << "YES\n";
}

signed main(){
    ios::sync_with_stdio(false);
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);freopen("answer.txt", "w", stdout);
	#endif 
    int testcases = 1; 
    cin >> testcases;
    while(testcases-->0){
        test();
    }    
}