#include<bits/stdc++.h>
using namespace std;
typedef long long ll; typedef unsigned long long ull; typedef long double ld;
const ll MOD = 1e9 + 7;

const int N = 1e6 + 7;
const int INF = 0x3f3f3f3f;

typedef pair<ll ,ll > PA;

PA a[N];

int main(void){
    int T;
	scanf("%lld" , &T);
	while(T--){
		ll A , B , n;
		scanf("%lld%lld%lld", &A , &B , &n);
		for(int i = 1 ; i <= n ; ++i){
			scanf("%lld" , &a[i].first);
		}
		ll ans = 0;
		for(int i = 1 ; i <= n ; ++i){
			scanf("%lld" , &a[i].second);
		}
		sort(a + 1 , a + n + 1);
		ll i;
		for(i = 1 ; i <= n ; ++i){
			if(B <= 0){
				cout<<"NO"<<endl;
				break;
			}
			ll k = ceil((double)a[i].second / A);
			if((k - 1) * a[i].first >= B){
				cout<<"NO"<<endl;
				break;
			}
			B -= k * a[i].first;
		}
		if(i > n){
			cout<<"YES"<<endl;
		}
	}
    
    return 0;
}