//codejunk
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define imax INT_MAX
#define imin INT_MIN
typedef long long int ll;
typedef double d;

int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        ll ha, hh, n;
        cin >> ha >> hh >> n;
        vector<pair<ll, ll>> m(n);
        for (int i = 0; i < n; i++)
            cin >> m[i].first;
        for (int i = 0; i < n; i++)
            cin >> m[i].second;
        bool flag = false;
        for (int i = 0; i < n; i++)
        {
            ll t = ceil((double)m[i].second / ha);
            hh -= t * m[i].first;
        }
        if (hh > 0)
            flag = true;
        else
            for (int i = 0; i < n; i++)
            {
                if (hh + m[i].first > 0)
                {
                    flag = true;
                    break;
                }
            }

        if (flag == true)
            cout << "YES\n";
        else
            cout << "NO\n";
    }

    return 0;
}