#include <bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long a,b,c,d;
        cin>>a>>b>>c>>d;
        int c1=0;
        //int flag=0;
        if(a<b)
        {
            printf("No\n");
            continue;
        }
        int dd=0,flag=0;
        long long ans=0;
        while(1)
        {
            ans=-1;
            long long low=1,high=1e18;
            while(low<=high)
            {
                long long mid=(low+high)/2;
                if((a-(mid*b))<=c&&(a-(mid*b))>=0)
                {
                    ans=a-(mid*b);

                    low=mid+1;
                }
                else if((a-(mid*b))<0)
                {

                    high=mid-1;
                }
                else
                {
                    low=mid+1;
                }
            }
            if(ans>c||ans<0)
            {
                //cout<<a<<" "<<b<<" "<<c<<endl;
                flag=1;
                printf("No\n")
                break;
            }
            else
            {
                dd++;
                a=ans+d;

            }
            if(dd==1e5)
                break;
        }
        if(!flag)
        {
            printf("Yes\n");
        }
    }
}
