백준 - 10250 ACM 호텔
문제
10250 ACM 호텔
답
kotlin code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
fun main() {
q10250()
}
fun q10250() {
val size = readln().toInt()
val inputs = List(size){ readln().split(" ").map { it.toInt() } }
for(input in inputs) {
val height = input[0]
val width = input[1]
val orderOfGuests = input[2]
var n = 0
for(w in 1..width) {
for(h in 1..height) {
if(++n == orderOfGuests) {
println((h * 100) + w)
break
}
}
if(n >= orderOfGuests) break
}
}
}
This post is licensed under CC BY 4.0 by the author.