#include <bits/stdc++.h>

using namespace std;
bool func(pair<long long,long long> &fi,pair<long long,long long>&se){
    return fi.first<se.first;
}
int main()
{
   int t=1;
   cin>>t;
   while(t--){
       long long a,b,n;
       cin>>a>>b>>n;
       pair<long long,long long>arr[n];
       
       for(int i=0;i<n;i++){
           cin>>arr[i].first;
       }
       for(int i=0;i<n;i++){
           cin>>arr[i].second;
       }
       sort(arr,arr+n,func);
      
       bool gamovida=true;
       for(int i=0;i<n;i++){
           int num=arr[i].second/a;
           if(num*a<arr[i].second)num++;
           b-=arr[i].first*num;
           if(b<=0&&i!=n-1){
               gamovida=false;
           }
           if(b<=0&&i==n-1){
               if(b+arr[i].first<=0){
                   gamovida=false;
               }
           }
       }
       if(gamovida==false){
           cout<<"NO"<<endl;
           continue;
       }
  
       if(gamovida==false){
           cout<<"NO"<<endl;
       }else{
           cout<<"YES"<<endl;
       }
       
   }
   
   return 0;
}