#include #include using namespace std; //変数デバッグ #define DEB(variable) cout <<#variable <<"="<(b);(inc)--) //incをaにし、a-b回(iがbより大きい間)処理を行う int main(){ int x, y,v; cin >> x >> y >> v; if(x<0){x=-x;} if(y<0){y=-y;} if(x>0&&y>0){ if (x % v) { if(y % v){ cout << 3 + (x / v)+(y/v) << endl; } else{ cout << 2 + (x / v)+(y/v) << endl; } } else{ if(y%v){ cout << 2 + (x / v)+(y/v) << endl; } else{ cout << 1+ (x / v)+(y/v) << endl; } } }else{ if (x % v) { if(y % v){ cout << 2 + (x / v)+(y/v) << endl; } else{ cout << 1 + (x / v)+(y/v) << endl; } } else{ if(y%v){ cout << 1 + (x / v)+(y/v) << endl; } else{ cout << (x / v)+(y/v) << endl; } } } return 0; }