#define _USE_MATH_DEFINES //M_PI #include //std::cout, std::cin #include //std::string #include //std::vector #include //std::valarray 数値のみの一次配列 #include //std::sort #include //localtime_s #include //abs #include //abs, pow, sqrt, sin, cos, #include //std::ifstream #include //std::setprecision #include //std::random(C++11) int main(void) { //test用 //std::ifstream in("test.txt"); //std::cin.rdbuf(in.rdbuf()); int X, Y, L; std::cin >> X >> Y >> L; int com = 0; if (Y != 0) { com += abs(Y / L); if (Y%L != 0) { com++; } if (Y < 0 && X != 0) { com++; } } if (X != 0) { com++; com += abs(X / L); if (X%L != 0) { com++; } } std::cout << com << std::endl; }