#include using namespace std; using Int = long long; //INSERT ABOVE HERE signed main(){ Int n,m,x,y; cin>>n>>m>>x>>y; x--;y--; Int a=(x%(2*m)); if(a>=m) a=(2*m-(a+1))%m; Int b=(y%(2*m)); if(b>=m) b=(2*m-(b+1))%m; //cout<