#include <bits/stdc++.h>
int main(void) {
  unsigned int T, a[10001], b[10001], c[10001], d[10001], all, i, j;
  int min = 10e9, one;
  scanf("%d", &T);
  for (i = 0; i < T; i++) {
    scanf("%d %d %d %d", &a[i], &b[i], &c[i], &d[i]);
  }
  for (i = 0; i < T; i++) {
    all = a[i];
    j = 0;
    one = all;
    while (1) {
      if (all >= b[i]) {
        all -= b[i];
      } else {
        puts("No");
        break;
      }
      if (j > a[i] * a[i] * d[i] * a[i]) {
        puts("Yes");
        break;
      } else if (j > a[i] * a[i] * d[i] && one - all > a[i] * a[i]) {
        puts("No");
      }
      if (all <= c[i]) all += d[i];
      j++;
    }
  }
  return 0;
}
