#include <stdio.h>
#include <stdlib.h>

int main() {
    int t;
    long long int f[1000000000000000000];
    scanf("%d", &t);
    for(int n = 0; n < t; n++)
    {
        long long int a,b,c,d;
        scanf("%ld %ld %ld %ld", &a, &b, &c, &d);
        for (int y = 0; ; y++) {
            for(int u = 0; u < y; u++)
            {
                if (a == f[u]) {
                    printf("Yes\n");
                    break;
                }
            }
            f[y] = a;
            a -= b;

            if (a < 0) {
                printf("No\n");
                break;
            }
            if (a < c) {
                a += d;
            }
        }

    }
}