import scala.io.StdIn object Problem172 { def proc(x: Int, y: Int, r: Int): Int = { // 1:1:sqrt(2) val len = r / Math.sqrt(2) // y = ax + b -> b = y - (-1x) -> b = y + x val dist = x.abs + len + y.abs + len dist.ceil.toInt } def main(args: Array[String]) { val xyr = StdIn.readLine().split(" ").map(_.toInt) val result: Int = proc(xyr(0), xyr(1), xyr(2)) println(result) } }