#include #include #include using namespace atcoder; using mint = modint998244353; using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 8000000000000000001 int main(){ int _t; cin>>_t; rep(_,_t){ long long M,A,B,K; cin>>M>>A>>B>>K; long long ans = 0; if(A