#include #define For(i,l,r) for (register int i=l; i<=r; i++) using namespace std; typedef unsigned long long LL; typedef signed long long ll; template inline void read(T &x) { char c = getchar(); int w = 1; x = 0; while (!isdigit(c)) (c == '-') && (w = -w), c = getchar(); while (isdigit(c)) x = (x << 1) + (x << 3) + (c ^ '0'), c = getchar(); x *= w; } int T; ll n, Max, Min, ave; signed main() { read(T); while (T -- > 0) { read(n); read(Max); read(Min); read(ave); if (Min > Max) { puts("no"); continue; } if (Min == Max) { if (Min == ave) puts("yes"); else puts("no"); continue; } if (n == 1) { if (Max == Min && Min == ave) puts("yes"); else puts("no"); } else if (n == 2) { if ((Max + Min) % 2 == 0 && (Max + Min) / 2 == ave) puts("yes"); else puts("no"); } else { ll s = ave * n - Min - Max; if (Min * (n-2) <= s && s <= Max * (n-2)) puts("yes"); else puts("no"); } } getchar(); return 0; }