#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, n, b, x, y, s;
  int q;
  cin >> q;
  while (q--) {
    cin >> a >> b >> n >> s;
    long long ts = a * n + b;
    if (ts < s) {
      cout << "NO\n";
      continue;
    }
    if (s % n > b) {
      cout << "NO\n";
      continue;
    }
    cout << "YES\n";
  }
}
