#include <bits/stdc++.h>
const int mod = 1e9 + 7;
const double PI = acos(-1);
using namespace std;
int N, M, K;
int d[105];
int f[105];
int pos[105];
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int T;
  cin >> T;
  while (T--) {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    bool ok = false;
    int temp = min(a, d / c);
    if (!temp) {
      if (b >= d) ok = true;
    } else {
      if (temp * c + b >= d) ok = true;
    }
    if (ok)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
