#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define ll long long #define ull unsigned long long const ll mod_1=1e9+7; const ll mod_2=998244353; const double eps_1=1e-5; const double eps_2=1e-10; const int maxn=1e5+10; int main() { int t,n,max1,min1,ave1; bool vis; scanf("%d",&t); while (t--) { scanf("%d%d%d%d",&n,&max1,&min1,&ave1); vis=1; if (max1*n-max1+min1ave1*n || max1