#include<bits/stdc++.h>
using namespace std;
typedef pair<long long int,long long int >  pi ;
int main()
{
    long long int a, b, n, aa[100005], bb[100005],x,y,s;

    int t;
    cin>>t;
    while(t--  && cin>>a>>b>>n){
        for(int i=0;i<n;i++)cin>>aa[i];
        for(int i=0;i<n;i++)cin>>bb[i];
        long long int sum =0, s;
        priority_queue< pi, vector< pi> , greater< pi> > q;
        for(int i=0;i<n;i++){
          q.push(make_pair(aa[i],bb[i]));
        }

        while(!q.empty()){
            x=q.top().first;
            y=q.top().second;
            s=(y-1)/a+1;
            b-= x*s;
            q.pop();
        }
         if(b>0 || (b+x)>0)cout<<"YES"<<endl;
         else cout<<"NO"<<endl;
    }


}
