#include<iostream>
#include<algorithm>
using namespace std;
const int N = 100010;
pair<long long, long long> q[N];
int main(){
    int t;
    scanf("%d", &t);
    while(t--)
    {
        long long A, B;
        int n;
        scanf("%lld%lld%d", &A, &B, &n);
        for(int i = 0; i < n; i++)  scanf("%lld", &q[i].first);
        for(int i = 0; i < n; i++)  scanf("%lld", &q[i].second);
        sort(q, q + n);
        int i = 0;
        while(i < n - 1 && B >= 0)
        {
            int j = q[i].second / A;
            if(q[i].second % A != 0) j++;
            B -= j * q[i].first;
            i++;
        }
        if(i < n - 1) puts("NO");
        else
        {
            int j = q[i].second / A;
            if(q[i].second % A == 0) j--;
            B -= j * q[i].first;
            if(B <= 0)  puts("NO");
            else  puts("YES");
        }
    }
    return 0;
}