
///              B I S M I L L A H I R  R A H M A N I R  R A H I M

#include<bits/stdc++.h>
#include<vector>
#include<set>
#include<map>
using namespace std;
typedef bool                      boo;
typedef int                       li;
typedef long long int             ll;
typedef unsigned long long int    l1;
typedef double                    db;
//----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

typedef vector < li >                   vli;
typedef vector < ll >                   vll;
typedef set < li >                      sli;
typedef set < ll >                      sll;
typedef pair < li , li >                pli;
typedef pair < ll , ll >                pll;
typedef map < li ,li >                  mli;
typedef map < ll ,ll >                  mll;
typedef vector < pair < li , li > >     vpi;
typedef vector < pair < ll , ll > >     vpl;

//----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

#define tc                        int t;cin>>t;while(t--)
#define inp_i(a,n)                for(i=0; i<n ;i++) cin>>a[i]
#define lp(i,a,b)                 for(i=a;i<b;i++)
#define len(z)                    z.begin(),z.end()
#define faster                    ios::sync_with_stdio(0); cin.tie(0);cout.tie(0);
#define input_txt                 freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define nl                        <<endl
#define spc                       <<" "
#define sp                        <<" "<<
#define co(x)                     cout<<x nl
#define sz(a)                     a.size()
#define cy                        cout<<"YES" nl
#define cn                        cout<<"NO" nl
#define pb                        push_back
#define F                         first
#define S                         second
#define pi                        2*acos(0.0)
#define clr(z)                    z.clear()
#define rn                        return
#define gcd(a,b)                  __gcd(a,b)
#define mem(b,z)                  memset(b,z,sizeof(b))
#define fixed(x)                  fixed<<setprecision(x)
const int lx=3e5+123;

void solve()
{
    ll a, h, n, s, x, y, d, f, tt=0, i, d1;
    cin>>a>>h>>n;
    pll p[n+10];
    for(i=0; i<n; i++) cin>>p[i].F;
    for(i=0; i<n; i++) cin>>p[i].S;
    sort(p,p+n);
    for(i=0; i<n; i++)
    {
        x=p[i].F;  y=p[i].S;
        d=y/a;
        if(y%a) d++;
        f=d*x;

        d1=h/x;
        if(h%x) d1++;

        if(d1>=d)
        {
            tt++;
            h-=f;
        }
        if(h<0) break;
    }
    //co(h);
    if(tt==n) cy;
    else cn;
}

int main()
{
faster
tc
solve();
// A L H A M D U L I L L A H
// 1 2 3 2 1

}
