T = int(input())

a = [0]*T
b = [0]*T
c = [0]*T
d = [0]*T

for i in range(T):
    s = input().rstrip().split(' ')
    a[i] = int(s[0])
    b[i] = int(s[1])
    c[i] = int(s[2])
    d[i] = int(s[3])

for i in range(T):
# for i in [0,1,2,3]:
    NoFlag=0
    print("i={}".format(i))
    if a[i] < b[i]:
        print("No")

    elif d[i] < b[i]:
        print("No")

    elif b[i] <= c[i]+1:
        print("Yes")
        
    else:
#         print(a[i])
#         a[i] = a[i] - ((a[i]-c[i]) // b[i]-1) *b[i]
        a[i] = a[i]%b[i] +b[i]
        for ii in range(c[i]):
            print(a[i])
            a[i] = a[i]-b[i]
            if a[i]<0:
                NoFlag=1
                print("No")
                break
            
            if a[i] <= c[i]:
                a[i] = a[i] + d[i]
#                 a[i] = a[i]%b[i] +b[i]
                a[i] = a[i] - ((a[i]-c[i]) // b[i]-1) *b[i]
            
        if NoFlag ==0:
            print("Yes")