#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
  int T;
  cin >> T;
  while (T--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    d -= min(a, d / c) * c;
    if (d > b)
      puts("NO");
    else
      puts("YES");
  }
  return 0;
}
