Home 백준 - 10250 ACM 호텔
Post
Cancel

백준 - 10250 ACM 호텔

문제

10250 ACM 호텔

screencapture

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.

백준 - 2941 크로아티아 알파벳

백준 - 5622 다이얼