백준 - 2869 달팽이는 올라가고 싶다
문제
2869 달팽이는 올라가고 싶다
답
kotlin code
1
2
3
4
5
6
7
8
9
10
11
fun main() {
q2869()
}
fun q2869() {
val inputs = readln().split(" ").map { it.toDouble() }
val tree = inputs[2] - inputs[0]
var attempts = 1.0
attempts += (tree / (inputs[0] - inputs[1]))
println(kotlin.math.ceil(attempts).toInt())
}
This post is licensed under CC BY 4.0 by the author.