#include #include #define sc(x) scanf("%lf", &(x)) #define sf(x) printf("%lld", (x)) #define mod 100000007 using namespace std; typedef long long ll; bool isPrime(int num) { if (num == 2 || num == 3) return true; if (num % 6 != 1 && num % 6 != 5) return false; int tmp = sqrt(num); for (int i = 5; i <= tmp; i += 6) if (num % i == 0 || num % (i + 2) == 0) return false; return true; } int main() { ll t; scanf("%lld", &t); while (t--) { double n,max,min,ave; sc(n), sc(max), sc(min), sc(ave); double bo; if(n>2) bo = (n * ave - max - min) / (n - 2); if(max>=min) if(n==1){ if(max==min&&min==ave) cout << "yes" << endl; else cout<<"no"<< endl; }else if(n==2){ if(max+min==ave*2) cout << "yes" << endl; else cout<<"no"<< endl; } else if(bo>=min&&bo<=max) cout << "yes" << endl; else cout << "no" << endl; else cout << "no" << endl; } return 0; }