#include #include #include using namespace std; int test, n; double maxN, minN, avg; int main() { scanf("%d", &test); while(test--) { scanf("%d%lf%lf%lf", &n, &maxN, &minN, &avg); if (minN <= avg && avg <= maxN) { if ((avg * n >= (maxN + (n - 1) * minN)) && (avg * n <= (minN + (n - 1) * maxN))) { printf("yes\n"); } else { printf("no\n"); } } else { printf("no\n"); } } return 0; }