#include<bits/stdc++.h>

using namespace std;
const int maxn = 1e5+10;
typedef long long ll;
int a[maxn],b[maxn];
int main()
{
    int t;cin>>t;
    while(t--){
    int A,B,n;
    cin>>A>>B>>n;
    int best=-1;
    for(int i=0;i<n;i++) {cin>>a[i];best=max(best,a[i]);}
    for(int i=0;i<n;i++) cin>>b[i];
    ll total=0;
    for(int i=0;i<n;i++){
        total+=(long long)ceil(b[i]*1.0/A)*a[i];
    }
    if(total<B+best) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    }
}
