/* Author: Zhikun Wang */ #include #define debug(x) cout<<#x<<'='< void read(T &x){ x = 0;int f = 1;char ch = getchar(); while(!isdigit(ch)){if(ch == '-')f*=-1;ch = getchar();} while(isdigit(ch)){x = x*10+ch-48; ch = getchar();}x*=f; } template void read(T &x,Args&... nxt){ read(x); read(nxt...); } #define rep(i,a,b) for(int i=a;i<(b);++i) #define all(x) begin(x),end(x) #define sz(x) (int)(x).size() typedef long long ll; typedef pair pii; typedef vector vi; int T; int main(){ read(T); while(T--){ int a,b,c,d; read(a,c,b,d); if(b>c){ cout<<"no\n"; continue; } if(a == 1){ if(b == c && c == d){ cout<<"yes\n"; }else{ cout<<"no\n"; } continue; } int mx = b+(a-1)*c,mi = c+(a-1)*b; if(mi<=d*a && d*a<=mx){ cout<<"yes\n"; }else{ cout<<"no\n"; } } return 0; }