#include using namespace std; int main(){ int N,M,X,Y; cin>>N>>M>>X>>Y; X--;Y--; int x=X%(2*M); int y=Y%(2*M); if(x>=M)x=2*M-1-x; if(y>=M)y=2*M-1-y; //cout<