// #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long LL; typedef vector::iterator viit; const int N = 3e5; const int MOD = 998244353; // const int MOD = 1e9 + 7; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); #ifndef ONLINE_JUDGE freopen("in.txt", "r", stdin); #endif int t; cin >> t; while (t--) { int n, maxv, minv, avg; cin >> n >> maxv >> minv >> avg; if (n == 1 && maxv != minv || minv > maxv || avg > maxv || avg < minv) { cout << "no" << endl; continue; } int tot = avg * n; if (maxv == minv) { int r = tot - maxv; int x = minv * (n - 1), y = maxv * (n - 1); cout << (x <= r && r <= y ? "yes" : "no") << endl; } else { int r = tot - maxv - minv; int x = minv * (n - 2), y = maxv * (n - 2); cout << (x <= r && r <= y ? "yes" : "no") << endl; } // int n; cin >> n; // vector A(n); // for (string &a: A) cin >> a; // if (A[0][0] == '#' || A.back().back() == '#') { // cout << 0 << endl; // continue; // } // vector> dp(n, vector(n, 0)); // dp[0][0] = 1; // for (int i = 0; i < n; i++) { // for (int j = 0; j < n; j++) { // if (A[i][j] == '#') continue; // if (i == 0 && j == 0) continue; // if (i == 0) dp[i][j] = dp[i][j - 1]; // else if (j == 0) dp[i][j] = dp[i - 1][j]; // else dp[i][j] = dp[i - 1][j] + dp[i][j - 1]; // } // } // cout << dp.back().back() << endl; } return 0; }