#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int q;
  cin >> q;
  vector<long long> a(q), b(q), n(q), S(q);
  for (int i = 0; i < (q); ++i) {
    cin >> a[i] >> b[i] >> n[i] >> S[i];
  }
  for (int i = 0; i < (q); ++i) {
    bool elf = false;
    if (a[i] * n[i] + b[i] >= S[i] && S[i] % n[i] <= b[i]) elf = true;
    if (elf)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
