#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
#define ll long long
#define rep(j,a,b) for(ll j = a; j < b; j++)
#define all(v) v.begin(),v.end()
#define FF first
#define SS second
#define pb push_back
#define mp make_pair
typedef pair<ll, ll> pii;
typedef vector<ll> vi;



int main(){
  
ios_base::sync_with_stdio(0);
  cin.tie(0);
 

  ll t; 
    cin>>t;

  while(t--){
 
   ll A,B,n; 
   cin>>A>>B>>n;
  
   ll arr[n],brr[n];
  rep(j,0,n) cin>>arr[j];
  rep(j,0,n) cin>>brr[j];

  rep(j,0,n)
  {
    ll dv= (brr[j]%A == 0 ? brr[j]/A : brr[j]/A +1 );
    B-=dv*arr[j];

  }
  ll f=-1;

  rep(j,0,n)
  {

    if(B+arr[j]>0)
       {
        f=0; break;
       }
  }

  
  if(f==-1) cout<<"NO"<<endl;
  else cout<<"YES"<<endl;





  }
     

}



      
  

