백준 #10250번 ACM 호텔

jhj·2024년 2월 18일

백준 JAVA

목록 보기
383/583
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int t = sc.nextInt();
		for(int i = 0; i < t; i++) {
			int h = sc.nextInt();
			int w = sc.nextInt();
			int n = sc.nextInt();
			
			String room = "";
			if(n % h != 0 && h * w >= n) {
				room += n % h;
				if(n / h + 1 < 10) {
					room += "0";
				}
				room += n / h + 1;
			}else if(n % h == 0 && h * w >= n){
				room += h;
				if(n / h < 10) {
					room += "0";
				}
				room += n / h;
			}
			System.out.println(room);
		}
		sc.close();
	}
}
profile
개발자를 꿈꾸는

0개의 댓글