#include #include #include #include ///////// #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define P(p) cout<<(p)<> X >> Y >> L; //上  上進む //右  右向く 右進む //左  左向く 左進む //右上 上進む 右向く 右進む //左上 上進む 左向く 左進む //下  右向く 下向く 下進む //右下 右向く 右進む 下向く 下進む //左下 左向く 左進む 下向く 下進む int ans = 0; if( Y < 0){ ans += 2; }else{//Y >=0 if( X != 0){ ++ans; } } X = abs(X); Y = abs(Y); ans += X/L; ans += Y/L; if(X%L != 0){ ++ans; } if(Y%L != 0){ ++ans; } P(ans); return 0; }