#include <bits/stdc++.h>
using namespace std;

typedef pair<int, int> pi;
typedef vector<pi> vpi;
typedef vector<int> vi;
typedef long long ll;
typedef double db;

const ll INF = 1e18;
const int MOD = 1e9 + 7;
const int MAXN = 1e5 + 5;
const db PI = 4 * atan((db)1);

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) FOR(i, 0, a)

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
void solve() {
    ll attack, health, n;
    cin >> attack >> health >> n;
    vector<ll> a(n), h(n);
    ll curmax, maxidx;
    curmax = maxidx = -1;
    F0R(i, n) {
        cin >> a[i];
    }
    F0R(i, n) {
        cin >> h[i];
    }
    ll total = 0;
    F0R(i, n) {
        curmax = max(curmax, a[i]);
        total += ceil((double)h[i] / attack - 1e-6) * (ll)a[i];
    }
    health -= total;
    if (health > -curmax) {
        cout << "YES\n";
    } else {
        cout << "NO\n";
    }
    return;
    F0R(i, n) {
        //ll totaldmg = total, curhealth;
        //totaldmg -= ceil((double)h[i] / attack - 1e-6) * (ll)a[i];
        //curhealth = health - totaldmg;
        if (health > -curmax) {
            cout << "YES\n";
            return;
        }
    }
    cout << "NO\n";
}
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int t;
    cin >> t;
    while (t--) {
        solve();
    }
}
// g++ -std=gnu++11 -O2 -Wall -Wshadow -Wl,--stack,100000000 B.cpp -o a && a
