#include using namespace std; int main(){ long long t; cin >> t; while(t--){ double n,mx,mi,avg; scanf("%lf%lf%lf%lf",&n,&mx,&mi,&avg); if(mx < mi || mx < avg || mi > avg){ printf("no\n"); continue; } double num1 = mi * (n - 1) + mx; double num2 = mx * (n - 1) + mi; num1 /= n; num2 /= n; if(avg >= num1 && avg <= num2){ printf("yes\n"); }else{ printf("no\n"); } } return 0; }