func_code_string: //#define _USE_MATH_DEFINES      #include<bits/stdc++.h>   //#pragma GCC optimize ( O3 )   //#pragma GCC target ( sse4 )   using namespace std;   #define ll long long   #define endl   n    #define f first   #define s second   #define ar array   #define pb push_back   #define eb emplace_back   #define mp make_pair   #define sz(X) ((int)(X).size())   #define rsz resize   #define pcnt __builtin_popcount   #define sort_unique(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))   #define get_pos(c, x) (lower_bound(c.begin(),c.end(),x)-c.begin())   #define all(X) (X).begin(), (X).end()   #define rall(X) (X).rbegin(), (X).rend()   #define ms(c, x)  memset(c,x,sizeof c)   #define  No(x) cout<<(x? NO : No )<<endl   #define  Yes(x) cout<<(x? YES : Yes )<<endl   #define  nl cout<<endl;   #define forn(i, n) for(int i = 0; i < int(n); i++)   #define fore(i, l, r) for(int i = l; i <r; i++)   #define fored(i, l, r) for(int i = r-1; i >=l; i--)   #define ford(i, n) for (int i = n - 1; i >= 0; --i)   using ld = long double;   using ul = unsigned long long;   using db = double;   using pi = pair<int, int>;   using pl = pair<ll, ll>;   using pd = pair<db, db>;   using vvi = vector<vector<int>>;   using vvl = vector<vector<ll>>;   using vi = vector<int>;   using vb = vector<bool>;   using vl = vector<ll>;   using vd = vector<ld>;   using vs = vector<string>;   using vpi = vector<pi>;   using vpl = vector<pl>;   using vpd = vector<pd>;   template<typename T, size_t size>   using va = vector<ar<T, size>>;   mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());      template<typename A, typename B>   istream &operator>>(istream &in, pair<A, B> &p) {       return in >> p.first >> p.second;   }      template<typename T>   istream &operator>>(istream &in, vector<T> &vec) {       for (auto &x : vec) {           in >> x;       }       return in;   }      template<typename T>   ostream &operator<<(ostream &os, const vector<T> &v) {       for (const auto &x : v) os << x <<    ;       return os;   }      template<typename T, size_t size>   ostream &operator<<(ostream &os, const array<T, size> &arr) {       for (const auto &x : arr) os << x <<    ;       return os;   }      template<typename A, typename B>   ostream &operator<<(ostream &os, const pair<A, B> &p) {       return os << p.first <<     << p.second;   }      template<class T>   bool ckmin(T &a, const T &b) { return b < a ? a = b, 1 : 0; }      template<class T>   bool ckmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }      void debug() { cerr << endl; }      template<typename Head, typename... Tail>   void debug(Head H, Tail... T) {       cerr <<     << H;       debug(T...);   }      #ifdef LOCAL   #define dbg(...) cerr <<__LINE__<<  [[DEBUG]]  << (  << #__VA_ARGS__ <<  ): , debug(__VA_ARGS__)   #else   #define dbg(...)   #endif      const ll mod = 1e9 + 7;   //const int mod = 998244353;   const ll INF = 2e18 + 6;         inline ll modPow(ll x, ll y, ll mod) {       ll res = 1;       x = x % mod;;       while (y > 0) {           if (y & 1) {               res = (res * x) % mod;           }           y = y >> 1;           x = (x * x) % mod;          }       return res;   }      int dx[4] = {0, 1, 0, -1};   int dy[4] = {1, 0, -1, 0};   char dirs[4] = { R ,  D ,  L ,  U };   unordered_map<char, int> rdirs = {{ R , 0},                                     { D , 1},                                     { L , 2},                                     { U , 3}};      void solve() {       ll a, b, n;       cin >> a >> b >> n;       vpi in(n);       forn(i,n)cin>>in[i].f;       forn(i,n)cin>>in[i].s;       sort(all(in));       forn(i, n) {           ll times = (in[i].s+a-1) / a;           b -= (times-1) * in[i].f;           if(b <=0)           {               No(1);               return;           }           b-=in[i].f;           if(b<0&&i!=n-1){               No(1);               return;           }       }       Yes(1);   }      int main() {          ios_base::sync_with_stdio(0);       cin.tie(0);       cout.tie(0);       cout << fixed << setprecision(6);   #ifdef LOCAL       freopen( input.txt ,  r , stdin);       freopen( output.txt ,  w , stdout);   #endif       int t = 1, tc = 1;       cin >> t;       while (t--) {   //        cout<< Case # <<tc<< :   ;           solve();           tc++;       }   #ifdef LOCAL       cerr << endl <<  Time elapsed :   << clock() * 1000.0 / CLOCKS_PER_SEC <<   ms  <<   n ;   #endif       return 0;   }   //NOTES   //look if it requires ll   // read the statement carefully   // check array bounds and cases for n=1