why I’m getting WA
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll t;
cin>>t;
while(t--){
ll n,k,x,y;
pair<ll,ll>p;
vector<pair<ll,ll>>v;
cin>>n>>k>>x>>y;
k--;
if(x>y){
ll curXY = y-x+n;
v.push_back(make_pair(n,curXY));
v.push_back(make_pair(curXY,n));
v.push_back(make_pair(0,x-y));
v.push_back(make_pair(x-y,0));
}
if(x<y){
ll curXY = -y+x+n;
v.push_back(make_pair(curXY,n));
v.push_back(make_pair(n,curXY));
v.push_back(make_pair(y-x,0));
v.push_back(make_pair(0,y-x));
}
if(x==y){
cout<<n<<" "<<n<<endl;
}
if(v.size()){
cout<<v[k%4].first<<" "<<v[k%4].second<<endl;
}
}
return 0;
}