개발일기

Baekjoo10250 ACM 호텔 본문

Algorithm/수학

Baekjoo10250 ACM 호텔

한둥둥 2022. 9. 30. 14:43

https://www.acmicpc.net/problem/10250

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        for(int i=0;i<n;i++){
            int height = scan.nextInt();
            int weight = scan.nextInt();
            int personNumber = scan.nextInt();
            
            int floor = personNumber % height;
            int stage = (personNumber / height) + 1;
            // 해당 측이 딱딱 떨어지는 경우 30층 60층 이런식
            if(floor == 0){
                floor = height;
                stage = personNumber / height;
            }
            int roomNumber = floor*100 + stage;
            System.out.println(roomNumber);
        }
    }
}