알고리즘/일반(단순구현)

[백준] 10250번 ACM 호텔 #Java

VIPeveloper 2022. 5. 7. 14:12
728x90
반응형
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        int N = Integer.parseInt(br.readLine());

        for (int i = 0; i < N; i++) {
            StringTokenizer st = new StringTokenizer(br.readLine()," ");
            int h,w,n;
            h = Integer.parseInt(st.nextToken());   // 6
            w = Integer.parseInt(st.nextToken());   // 12
            n = Integer.parseInt(st.nextToken());   // 10

            int H = n%h==0 ? h : n%h;
            int W = n%h==0 ? n/h : n/h+1;

            System.out.println(((H * 100) + W));

        }
    }
}
728x90
반응형