#include <bits/stdc++.h>
#include <iostream>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;

#define f(i,n)           for(int i=0;i<n;i++)
#define pb               push_back
#define fi               first
#define se               second
#define setzero(a)       memset(a,0,sizeof(a))
#define precision(x,y)   fixed<<setprecision(y)<<x
#define mod              1000000007

// primeNumbers contains all the prime numbers till 1299720 (100000 prime numbers)
int primeNumbers[100000];
void SieveOfEratosthenes(int n)     // O(nlog(log(n)))
{
    bool prime[n+1]; 
    memset(prime, true, sizeof(prime)); 
  
    for (int p=2; p*p<=n; p++) 
    {
        if (prime[p] == true) 
        { 
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    }
    int i=0;
    for (int p=2; p<=n; p++) 
       if (prime[p]) 
       {
           primeNumbers[i] = p;
           i ++;
       }
}

int binarySearch(int arr[], int l, int r, int x)  // Recursive 
{ 
    if (r >= l) 
    { 
        int mid = l + (r - l) / 2; 
  
        if (arr[mid] == x) 
            return mid; 
   
        if (arr[mid] > x) 
            return binarySearch(arr, l, mid - 1, x); 
  
        return binarySearch(arr, mid + 1, r, x); 
    } 
  
    // We reach here when element is not present in array
    return -1; 
}

/*Driver Code*/
int main() {
    
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
	ll t;
	cin >> t;
	while(t--)
	{
	    ll a,b,n;
        cin>>a>>b>>n;
        ll h[n];
        ll atp[n];
        f(i,n)
        {
            cin >> atp[i];
        }
        f(i,n)
        {
            cin >> h[i];
        }
        vector<pair<ll,ll>>v;
        f(i,n)
        {
            v.push_back({atp[i],h[i]});
        }
        
        sort(v.begin(),v.end());
        
        bool ans = true;
        
        f(i,n)
        {
            if(b<=0)
            {
                ans = false;
                break;
            }
            ll x = v[i].first;
            ll y = v[i].second;
            ll z = y/a;
            if(y%a != 0)
                z++;
            b = b - (z-1)*x;
            if(b <= 0)
            {
                ans = false;
                break;
            }
            b = b - x;
        }
        
        
        if(ans+2-2)
            cout << "YES\n";
            
            
        else
            cout<<"NO\n";
	}
	return 0;
}
