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

long long att[1000111];
long long hp[1000111];

int main() {
  
  int t;
  scanf("%d", &t);
  while (t--) {
    long long herohp, heroatt;
    int n;
    scanf("%lld%lld%d", &heroatt, &herohp, &n);
    for (int i = 1; i <= n; i++) {
      scanf("%lld", &att[i]);
    }
    for (int i = 1; i <= n; i++) {
      scanf("%lld", &hp[i]);
      if (hp[i] > heroatt) {
        long long hits = hp[i] / heroatt;
        if (hp[i] % heroatt == 0) {
          hits--;
        }
        herohp -= hits * att[i];
      }
    }
    sort (att+1, att+n+1);
    for (int i = 1; i < n; i++) {
      herohp -= att[i];
    }
    if (herohp > 0) printf("YES\n");
    else printf("NO\n");
  }
  return 0;
}