문제 : 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 num = scan.nextInt();
        String[] result = new String[num];

        for (int i = 0; i < num; i++) {
            int h = scan.nextInt();
            int w = scan.nextInt();
            int c = scan.nextInt();
            int clientH = 0;
            int clientW = 0;

            if (c % h == 0) {
                clientH = h;
                clientW = c / h;
            } else {
                clientW = c / h + 1;
                clientH = c % h;
            }
            result[i] = String.format("%d%02d", clientH, clientW);
        }
        for (String res : result) {
            System.out.println(res);
        }
        scan.close();
    }
}

+ Recent posts

"여기"를 클릭하면 광고 제거.