#include<bits/stdc++.h>
using namespace std;
typedef  long long ll;
#define fat(x) for(auto it:x)
#define  pb push_back
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define mem(x) memset(x,0,sizeof(x))
#define coutY cout<<"YES"<<endl
#define coutN cout<<"NO"<<endl
#define mp make_pair
const int N = 1e6 + 5;
const ll MOD = 1e9 + 7;
const ll INF = 0x3f3f3f3f;
ll t, n;
ll A, B, a[N], b[N];
int main()
{
	cin.tie(0); std::ios::sync_with_stdio(false);
	//freopen("c:\\users\\雷神\\desktop\\题\\data.in", "r", stdin);
	//freopen("c:\\users\\雷神\\desktop\\题\\myout.out", "w", stdout);
	cin >> t;
	while (t--)
	{
		cin >> A >> B >> n;
		ll maxx = 0,hu=0;
		rep(i, 1, n)
			cin >> a[i], maxx = max(maxx, a[i]);
		rep(i, 1, n)
		{
			cin >> b[i];
			hu += a[i]*ceil(1.0 * b[i] / A);
		}
		if (hu - maxx < B)
			coutY;
		else
			coutN;
	}
	return 0;
}
