#include <iostream>
using namespace std;
#include <bits/stdc++.h>
long long a[100005];
long long b[100005];
long long hurt[100005];
int main(){
    int t;
    cin>>t;
    while(t--){
        long long A,B,n;
        scanf("%lld %lld %lld",&A,&B,&n);
        for(int i=1;i<=n;i++){
            scanf("%lld",&a[i]);
        }
        int mmax=1;
        for(int i=1;i<=n;i++){
            scanf("%lld",&b[i]);
            long long times=(b[i]+A-1)/A;
            hurt[i]=times*a[i];
            mmax=a[i]>a[mmax]?i:mmax;
        }
        int is=1;
        for(int i=1;i<=n;i++){
            B-=hurt[i];
        }
        if(B<=0)
            is=0;
        if(is==0){
            B+=hurt[mmax];
            int times=(B+a[mmax]-1)/(a[mmax]);
            b[mmax]-=times*A;
            if(b[mmax]<=0)
                is=1;
        }
        if(is)
            cout<<"Yes";
        else
            cout<<"No";
        if(t)
            cout<<endl;
    }
}

