package yukicoder import kotlin.math.absoluteValue fun main() { val x = readLine()!!.toInt() val y = readLine()!!.toInt() val l = readLine()!!.toInt() var count = 0 // 回数 if (y < 0) count += 2 // 方向転換 else if (x != 0) count++ count += y.absoluteValue / l // 高速 count += y.absoluteValue % l // 残り count += x.absoluteValue / l // 高速 count += x.absoluteValue % l // 残り println(count) }