#include typedef long long ll; typedef std::pair pii; const int N = 1e6 + 10; const int inf = 0x3f3f3f3f; const int mod = 1e9 + 7; const double eps = 1e-9; int main() { #ifdef ONLINE_JUDGE #else freopen("in.txt","r",stdin); freopen("out.txt","w",stdout); #endif std::ios::sync_with_stdio(0); std::cin.tie(0); int t; std::cin >> t; while(t--) { int n, max, min, avg; std::cin >> n >> max >> min >> avg; bool f = false; if(n == 1) { if(max == min && max == avg) f = true; } if(n == 2) { if(avg * 2 == max + min) f = true; } else { if(avg * n <= max * (n - 1) + min && avg * n >= min * (n - 1) + max) f = true; } if(max < min || avg > max || avg < min) f = false; if(f) std::cout << "yes\n"; else std::cout << "no\n"; } }