#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned long long ull; #define int long long const int maxn = 2e6 + 7; const int INF = (1 << 31) - 1; const int mod = 1e9 + 7; const double PI = acos(-1); inline ll ksm(ll a, ll p) { ll res = 1; while (p) { if (p & 1)res *= a; a *= a; p >>= 1; }return res; } void work() { int n, mx, mn, a; cin >> n >> mx >> mn >> a; if (mn > mx) { cout << "no\n"; return; } if (n == 1) { if (mx == mn && mn == a)cout << "yes\n"; else cout << "no\n"; return; } ll sum = a * n; if (mx + mn + (n - 2) * mn <= sum && mx + mn + (n - 2) * mx >= sum)cout << "yes\n"; else cout << "no\n"; } signed main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int T; cin >> T; for (int i = 1; i <= T; ++i) { //cout << "Case #" << i << ": "; work(); } }