题目描述
样例
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
const int N=10010;
int a[N][N];
int main(){
int w,m,n;
cin >> w >> m >> n;
m--;
n--;
int rm=m/w;
int rn=n/w;
int cm=m%w;
int cn=n%w;
int count = abs(rm-rn);
if(rm%2==rn%2){
count+=abs(cm-cn);
}
else{
count+=abs(cm+cn-w+1);
}
cout << count;
return 0;
}