// Problem: CF837D Round Subset // Contest: Luogu // URL: https://www.luogu.com.cn/problem/CF837D // Memory Limit: 250 MB // Time Limit: 2000 ms // Author:Cutele // // Powered by CP Editor (https://cpeditor.org) #pragma GCC optimize(1) #pragma GCC optimize(2) #pragma GCC optimize(3,"Ofast","inline") #include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pairPLL; typedef pairPII; typedef pairPDD; #define I_int ll inline ll read(){ll x = 0, f = 1;char ch = getchar();while(ch < '0' || ch > '9'){if(ch == '-')f = -1;ch = getchar();}while(ch >= '0' && ch <= '9'){x = x * 10 + ch - '0';ch = getchar();}return x * f;} inline void write(ll x){if (x < 0) x = ~x + 1, putchar('-');if (x > 9) write(x / 10);putchar(x % 10 + '0');} #define read read() #define closeSync ios::sync_with_stdio(0);cin.tie(0);cout.tie(0) #define multiCase int T;cin>>T;for(int t=1;t<=T;t++) #define rep(i,a,b) for(int i=(a);i<=(b);i++) #define repp(i,a,b) for(int i=(a);i<(b);i++) #define per(i,a,b) for(int i=(a);i>=(b);i--) #define perr(i,a,b) for(int i=(a);i>(b);i--) const ll mod=1e9+7; ll ksm(ll a, ll b){ll res = 1;while(b){if(b&1)res=res*a%mod;a=a*a%mod;b>>=1;}return res;} int main(){ int _=read; while(_--){ ll n=read,maxx=read,minn=read,ave=read; if(maxx=minn&&ave<=maxx)){ puts("no");continue; } if(n==1){ if(maxx==minn&&minn==ave) puts("yes"); else puts("no"); } else if(n==2){ if((maxx+minn)%2==0&&(maxx+minn)/2==ave) puts("yes"); else puts("no"); } else{ ll sum_max=(n-1)*maxx+minn; ll sum_min=(n-1)*minn+maxx; ll sum_ave=n*ave; if(sum_ave<=sum_max&&sum_ave>=sum_min) puts("yes"); else puts("no"); } } return 0; }