#include<bits/stdc++.h>

using namespace std;

#define LL long long
#define DD double
#define Pb push_back
#define Bp pop_back
#define Pf push_front
#define Fp pop_front
#define Ub upper_bound
#define Lb lower_bound
#define Bs binary_search
#define In insert
#define Mp make_pair
#define All(x) x.begin(), x.end()
#define mem(a, b) memset(a, b, sizeof(a))
#define fast ios_base::sync_with_stdio(0);cin.tie(0)
#define X first
#define Y second

const int mx1 = 55;
const int mx2 = 505;
const int mx3 = 5005;
const int mx4 = 30005;
const int mx5 = 100005;
const int mx6 = 1000005;

typedef vector<int> Vi;
typedef vector<DD> Vd;
typedef vector<bool> Vb;
typedef vector<Vi> VVi;
typedef pair<int, int> Pii;
typedef pair<DD, DD> Pdd;
typedef vector<Pii> Vpi;
typedef vector<Pdd> Vpd;
typedef queue<int> Qi;
typedef stack<int> Si;
typedef deque<int> Di;

int _toggle(int N, int pos) {return N = N ^ (1 << pos);}
int _set(int N, int pos) {return N = N | (1 << pos);}
int _reset(int N, int pos) {return N = N & ~(1 << pos);}
bool _check(int N, int pos) {return (bool)(N & (1 << pos));}
bool _upper(char a) {return a >= 'A' && a <= 'Z';}
bool _lower(char a) {return a >= 'a' && a <= 'z';}
bool _digit(char a) {return a >= '0' && a <= '9';}

int dx[] = {1, -1, 0, 0, -1, -1, 1, 1};
int dy[] = {0, 0, 1, -1, -1, 1, -1, 1};

///******************************************************///

int n, A, B;
LL a[mx5], b[mx5], need[mx5];

void solve()
{
    cin >> A >> B >> n;
    for(int i = 1; i <= n; i++){
        cin >> a[i];
    }
    LL tot = 0;
    for(int i = 1; i <= n; i++){
        cin >> b[i];
        tot += (b[i] + A - 1) / A * a[i];
    }
    if(tot < B){
        cout << "YES\n";
        return;
    }
    tot -= B;
    for(int i = 1; i <= n; i++){
        if(a[i] > tot){
            cout << "YES\n";
            return;
        }
    }
    cout << "NO\n";
}

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    fast;
    int tc = 1;
    cin >> tc;
    while(tc--){
        solve();
    }
}

