#include using namespace std; int main() { int T; cin>>T; while(T--){ long long n, MAX, MIN, AVE; cin>> n >>MAX>>MIN>>AVE; bool ans = false; if(n==1){ ans = ((MAX==MIN) && (MIN==AVE)); } else if (n==2){ ans = ((MAX>=MIN) && (2*AVE==MAX + MIN)); } else{ long long sum = n*AVE - MAX - MIN; //num = sum / (n-2); ans = ((MAX*(n-2) >= sum) && (MIN*(n-2) <= sum)); //ans = ((MAX==MIN) && (MIN==AVE)) || ((MAX*(n-2) > sum) && (MIN*(n-2) < sum)); } if (ans) printf("yes\n"); else printf("no\n"); } return 0; } /* #include using namespace std; int main() { int T; cin>>T; while(T--){ long long n, MAX, MIN, AVE; cin>> n >>MAX>>MIN>>AVE; bool ans = false; if(n==1){ ans = ((MAX==MIN) && (MIN==AVE)); } else if (n==2){ ans = ((MAX==MIN) && (MIN==AVE)) || ((MAX>AVE) && (MIN= sum) && (MIN*(n-2) <= sum)); //ans = ((MAX==MIN) && (MIN==AVE)) || ((MAX*(n-2) > sum) && (MIN*(n-2) < sum)); } if (ans) printf("yes\n"); else printf("no\n"); } return 0; } */