#include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef long long ll; const int maxn = 2e6 + 7; int n , m , a[maxn]; int T; int ma , mi , ave; int main() { scanf("%d",&T); while(T--){ scanf("%d%d%d%d",&n,&ma,&mi,&ave); if(ma == mi && mi == ave){ printf ("yes\n"); continue; } else{ if(mi > ma){ printf ("no\n"); continue; } else if(ave > ma){ printf ("no\n"); continue; } } if(n == 1){ if(ma == mi && mi == ave) printf ("yes\n"); else printf ("no\n"); continue; } int l = (n - 1) * mi + ma; int r = (n - 1) * ma + mi; if(ave * n >= l && ave * n <= r){ printf ("yes\n"); } else printf ("no\n"); } return 0; }