#include <bits/stdc++.h> 
using namespace std; 
#define ll long long
void run(){
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL); 
}
const int N=2e5+5;
void solve(){
    ll a,b,n;
    cin>>a>>b>>n;
    pair<ll,ll> p[n];
    for(int i = 0 ; i < n ; i++){
        cin>>p[i].first;
    }
    for(int i = 0 ; i < n ; i++){
        cin>>p[i].second;
    }
    sort(p,p+n);
    for(int i = 0 ; i < n ; i++){
        if(b<=0){
           cout<<"NO\n";
           return;
        }
        ll need=(p[i].second/a)+(p[i].second%a!=0);
        ll need2=(b/p[i].first)+(b%p[i].first!=0);
        if(need2<need){
            cout<<"NO\n";
            return;
        }
        b-=1LL*p[i].first*need;
    }
    cout<<"YES\n";
}
int main()
{   
   // run();
    int t = 1; 
    cin>>t;
    while (t--) { 
        solve(); 
    } 
    return 0; 
} 