#include #include using namespace std; void solve() { double n, a, b, c; scanf("%lf%lf%lf%lf", &n, &a, &b, &c); if(a < b) { printf("no\n"); return; } if(n == 1) { if(a != c || a != b) printf("no\n"); else printf("yes\n"); return; } else if(n == 2) { if(fabs((a+b) /2 - c) > 0.00000001) printf("no\n"); else printf("yes\n"); return; } double ans = c*n - (a+b); ans = ans /(n-2); if(ans >= b && ans <= a) printf("yes\n"); else printf("no\n"); } int main() { int T; scanf("%d", &T); while(T --) { solve(); } return 0; }