ShanLin | 2021-08-07 20:46:37
Author
#include<iostream>
#include<cstring>
using namespace std;
int main(){
int n1; cin>>n1;
for(int i=0;i<n1;i++){
int n,max,min,ave;
scanf("%d%d%d%d",&n,&max,&min,&ave);
int sum=n*ave;
int ma=max*(n-1)+min,mi=min*(n-1)+max;/
if(sum<=ma&&sum>=mi&&max>=ave&&ave>=min) cout<<"yes"<<endl;
else cout<<"no";
}
}