/*
Editor: Abdelrahman Hossam
Nickname: Blobo2_Blobo2
IOI next year isA :)
*/

//#pragma GCC optimize ("O3")
//#pragma GCC optimize ("unroll-loops")
#include<bits/stdc++.h>
#define int long long
#define endl "\n"
#define PI 3.1415926535897932384626433
#define ceil1(a,b)   (a+(b-1))/b
#define all(v)  v.begin(),v.end()
#define gen(arr,n,nxt)  generate(arr,arr+n,nxt)
#define base ios_base::sync_with_stdio(false);cin.tie(0);
#define open freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);

using namespace std;
const int mo=1e9+7;
int nxt(){int x;cin>>x;return x;}
int mod(int n,int m){int ans=n%m;if(ans<0)ans+=m;return ans;}

signed main(){
    base
    int qu=nxt();
    while(qu--){
        int a=nxt(),b=nxt(),n=nxt();
        int arr[n],brr[n];
        gen(arr,n,nxt);
        gen(brr,n,nxt);
        vector<pair<int,int> >v;
        for(int i=0;i<n;i++)
            v.push_back({arr[i],brr[i]});
        sort(all(v));
        bool ok=0;
        for(int i=0;i<n;i++){
            int x=(v[i].second+(a-1))/a;
            int health=x*v[i].first;
            b-=health;
            if(b<=0){
                if(i==n-1){
                    b=abs(b);
                    b=(b+1+(v[i].first-1))/v[i].first;
                    if(b>1)ok=1;
                    break;
                }
                else{
                    ok=1;
                    break;
                }
            }
        }
        cout<<(ok?"NO":"YES")<<endl;
    }
    return 0;
}
