- 문제 이름: ACM Hotel (원문)
- 문제 번호: 10250
- 문제 유형: -
- 풀이 언어:
- 제출 시간: 2019년 5월 12일 17시 2분 12초
- 원본 링크: https://www.acmicpc.net/problem/10250
Jiwoo, the manager of the ACM Hotel, is about to assign the vacant rooms to the guests upon their arrival. According to customers’ survey, the customers prefer the rooms which are close to the main entrance on-walk. Jiwoo likes to assign the rooms on this policy. Write a program to help Jiwoo on assigning the rooms for the guests.
For simplicity, let’s assume that the ACM hotel is a rectangular shape, an H story building with W rooms on each floor (1 ≤ H, W ≤ 99) and that the only one elevator is on the leftmost side (see Figure 1). Let’s call this kind of hotel as H × W shaped. The main entrance is located on the first floor near the elevator. You may ignore the distance between the gate and the elevator. Also assume that the distances between neighboring rooms are all the same, the unit distance, and that all the rooms only in the front side of the hotel.
The rooms are numbered in YXX or YYXX style where Y or YY denotes the number of the floor and XX, the index of the room counted from the left. Therefore the room shaded in Figure 1 should be 305.