//基础题 #include <iostream> #include <cstring> using namespace std; const int N = 1e3 + 5; int supply[N]; int cost_day[N]; int main() { int t, n, b; cin >> t; while (t--) { int sum = 0; memset(supply, 0, sizeof(supply)); memset(cost_day, 0, sizeof(cost_day)); cin >> n >> b; for (int i = 0; i < n; i++) cin >> supply[i]; for (int i = 0; i < n - 1; i++) cin >> cost_day[i]; bool flag = true; sum += supply[0]; for (int i = 1; i < n; i++) { if (sum < b * cost_day[i - 1]) { flag = false; break; } sum -= b * cost_day[i - 1]; sum += supply[i]; } if (flag) cout << "Yes" << endl; else cout << "No" << endl; } return 0; }