#include <bits/stdc++.h>
using namespace std;
int main() {
  int T, f;
  long long A, B, C, D, a, b, c, d, count, e;
  cin >> T;
  for (int i = 1; i <= T; i++) {
    count = 0;
    cin >> A >> B >> C >> D;
    a = A;
    while (1) {
      cout << a << endl;
      if (a - C > B) {
        d = a % B;
        a = (B - d - 0.5) / B + B + d;
        cout << "d " << d << endl;
      }
      b = a + (D - B);
      c = a - B;
      cout << b << " " << c << endl;
      if (c <= C) {
        if (c < 0) {
          f = 0;
          break;
        }
        a = b;
      } else {
        a = c;
        if (a >= B) {
          f = 1;
          break;
        }
      }
      if (a < B) {
        f = 0;
        break;
      } else if (a % B == A % B) {
        f = 1;
        break;
      }
    }
    cout << (f ? "Yes" : "No") << endl;
  }
  return 0;
}
