题目:1219. 移动距离
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N=1e5+10;
const int mod=100000007;
int w,m,n;
int main(){
cin>>w>>m>>n;
m--;
n--;
int x1=m/w;
int x2=n/w;
int y1=m%w;
int y2=n%w;
if(x1&1) y1=w-y1-1;
if(x2&1) y2=w-y2-1;
cout<<abs(x1-x2)+abs(y1-y2);
return 0;
}